-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
Encoded slashes not working as expected in production in a catch-all route #24775
Comments
I encountered exact the same issue. This should be a Vercel issue not a Nextjs one. I guess Vercel somehow received the My workaround is |
Thank you for your reply, Haishan. That's a wonderful workaround, but I don't like it for Lingva because I'm interested in providing a queriable URL for various purposes. The only way I would apply that is to conditionally encode/decode to base64 if it contains a slash. I will consider it. But anyway thanks for the idea, that may help others with the same issue. And if you say it's a Vercel bug (which is very possible) I hope some Vercel member sees this issue and tries to fix it. Regards, David. |
Hi, this should be fixed in |
Sorry for the late reply @ijjk. Thanks for your help. I've just tested it out and it seems to work perfectly. I think it's ready to merge. Thanks again. Regards, David. |
This is a follow-up to vercel#26963 which after discussion changes to interpolate the decoded variant of the value into the path. x-ref: vercel#24775 ## Bug - [x] Related issues linked using `fixes #number` - [x] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md`
Hello again. I'm sorry to reopen the issue, but this bug has reappeared, this time on API routes. Thanks again. |
This comment has been minimized.
This comment has been minimized.
This issue has been automatically locked due to no recent activity. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you. |
What version of Next.js are you using?
10.0.2
What version of Node.js are you using?
14.16.1
What browser are you using?
Firefox & Brave
What operating system are you using?
Ubuntu Linux
How are you deploying your application?
Vercel
Describe the Bug
My application is using a catch-all route which tests that the slug length is 3 or less and returns
notFound
if other. The last slug part has an arbitrary content, including another slashes, but it's encoded usingencodeURIComponent
so it doesn't get to conflict with the catch-all filter.Locally, everything works correctly, but in production (in Vercel) breaks when using slashes, as reported in thedaviddelta/lingva-translate#18. I've tested this issue reports and it's not only in links but in everything that contains a slash i.e. https://lingva.ml/en/es/like%20%2F%20dislike, even though locally it works great (fell free to clone that repo to test it).
Expected Behavior
To don't break nor send 404 when using encoded slashes on filtered catch-all routes, as works locally.
To Reproduce
Go to https://lingva.ml and write any translation that contains a slash.
The text was updated successfully, but these errors were encountered: