Error page if url contains percentage, which happens on redirection with non ascii characters in url
See original GitHub issueWhat version of Next.js are you using?
12
What version of Node.js are you using?
12.22.0
What browser are you using?
Chrome
What operating system are you using?
macOS
How are you deploying your application?
next start
Describe the Bug
we get 400 Bad request if page contains “%”, we also don’t get error/issue on terminal it just compiles _error
This occurs because we are redirecting url’s with non ascii characters, our page old-page/à becomes page/%E0
return {
redirect: {
destination: `/page/${query?.id || ""}`,
permanent: false,
},
};
I think while redirecting it is encoding url, so we get %. nevertheless it should not break i think
Expected Behavior
Redirect correctly, without changing url
To Reproduce
Open a url with %
Issue Analytics
- State:
- Created 2 years ago
- Reactions:3
- Comments:9 (2 by maintainers)
Top Results From Across the Web
HTTP Redirect with non-ASCII characters in the URL
The cause of the error is that HTTP redirects are restricted to ASCII characters in the redirect result, as per the RFC. I...
Read more >How to Fix Non-ASCII Characters in a URL - Sitechecker
We'll show you how to fix non-ASCII characters within a URL. Learn more about what characters are valid for URLs.
Read more >How to stop error 400 when URL contains a percent % symbol ...
Have the 'error 400' page check for a % in the URL on the server and then redirect to another page (or 404...
Read more >Using URL encoding to handle special characters in a ...
For instance, the "#" character needs to be encoded because it has a special meaning of that of an html anchor. The <space>...
Read more >URL Encoding | Google Maps Platform
Some characters cannot be part of a URL (for example, the space) and some other characters have a special meaning in a URL....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I will try to confirm this with new canary build this week @timneutkens
I experience exactly the same problem with ?