-
Notifications
You must be signed in to change notification settings - Fork 27.7k
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
[Next 9.5.4] [ERR_INVALID_CHAR]: Invalid character in header content ["Location"] #17907
Comments
It seems to be fixed by this PR #18149 . |
Can confirm that this was fixed in the v10 release of next.js as well. |
Closing as this should be resolved now per the above comments |
Looks like this problem persists somehow (or is related). We are getting 500 errors when requests to our site include a slash before the url query, and due an invalid character in it
Here is a codesandbox to reproduce this issue: Should I open a new issue? Thanks! |
We encountered this problem when trying to redirect to a url with non-ascii characters Our solution: wrap the non-ascii characters with |
The error occurs in these lines:
if you wrap I'm at v9.5.2 so I guess it was solved at later versions. |
This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
Bug report
Describe the bug
internal server error occurs when redirect path includes query strings of non-ascii character(like Japanese).
in this PR, non-ascii character is passed to 'Location' header without encoding.
https://github.com/vercel/next.js/pull/17323/files
To Reproduce
next.config.js
with trailing slash configtrue
./about?tag=日本語
page, not/about/?tag=日本語
. and 500 error occurs.here is a demo.
https://codesandbox.io/s/non-ascii-query-error-c8esl
Expected behavior
redirected to
/about/?tag=日本語
, with trailing slash.otherwise, encode japanese character.
The text was updated successfully, but these errors were encountered: