Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: path without trailing slash gets 404 error for relative links on page #529

Open
sashasushko opened this issue Dec 14, 2022 · 2 comments

Comments

@sashasushko
Copy link

In continuation of the conversation #34 (comment)


We're using the Linkinator in our Neon docs.

On the page https://neon.tech/docs/reference/api-reference/ there are two relative links:
Снимок экрана 2022-12-13 в 08 36 05
Снимок экрана 2022-12-13 в 08 36 15

You can check, that them are perfectly working in browser. Also, these links are web-correct.

And when I'm checking this page by the Linkinator:

npm run check:broken-links -- https://neon.tech/docs/reference/api-reference

I'm getting errors:

{
  "links": [
    {
      "url": "https://neon.tech/manage/api-keys",
      "status": 404,
      "state": "BROKEN",
      "parent": "https://neon.tech/docs/reference/api-reference"
    },
    {
      "url": "https://neon.tech/manage/branches/",
      "status": 404,
      "state": "BROKEN",
      "parent": "https://neon.tech/docs/reference/api-reference"
    }
  ],
  "passed": false
}

But! If I'm passing to the Linkinator the same link with trailing slash:

npm run check:broken-links -- https://neon.tech/docs/reference/api-reference/

There are no errors:

{
  "links": [],
  "passed": true
}

I think the problem is that the Linkinator is cutting end part of path for relative links before concat it with relative href:

https://neon.tech/docs/reference/api-reference > https://neon.tech/docs/reference/ > https://neon.tech/docs/reference/ + ../../manage/api-keys = https://neon.tech/manage/api-keys

@hybridherbst
Copy link

+1, also happens here.

Example:

  • https://engine.needle.tools/samples-uploads/pencil-sword (logs missing links with incorrect links)
  • https://engine.needle.tools/samples-uploads/pencil-sword/ (works fine)

@hybridherbst
Copy link

@JustinBeckwith mind taking a look? :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants