Percent-encoding parts of URL leads to a 404
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 29k
- Forks
- 4k
- Avg merge
- 1d 2h
- Merged PRs (30d)
- 71
Description
Bug description
URLs with percent-encoded characters are not resolved properly. They lead to a 404 page even though the canonical page exists.
How to reproduce
- Find a working GitBook URL, e.g. https://gitbook.com/docs/getting-started/quickstart
- Percent encode one or more characters in the URL path, e.g. https://gitbook.com/docs/getting-started/quickstar%74
- Notice that the page gives a 404 "Page not found" error, and that your browser has correctly folded the URL in the address bar to the canonical form (but it still requests the %-encoded form from the server!)
Additional context
Docs: https://developer.mozilla.org/en-US/docs/Glossary/Percent-encoding
Although it's strange to percent-encode non-reserved characters, it's still part of the standard. I found it useful for making links to pages with - characters, as they break automatic URL creation in Microsoft Word references, while %2d works as expected on most websites.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the issue with the canonical GitBook URL and the percent-encoded path shown in the report, then compare the two requests. Use the linked MDN percent-encoding reference to confirm the expected behavior. Done means encoded non-reserved characters resolve to the existing canonical page instead of returning a 404.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- web-dev
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100