-
-
Notifications
You must be signed in to change notification settings - Fork 210
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
Malformed URLs crash the entire app with a 500 Error #1351
Comments
Thanks for the report! After some local testing I found that Next.js might also return a 400 status code, maybe depending on if you have a segment like I've set up #1353 where the invalid request is simply forwarded, letting Next.js handle it. As far as I can tell, in invalid pathname never reaches the app, but is caught by the error handling of Next.js at some level. Does that sound reasonable to you? |
Sounds good! Thanks! Schöne Grüße in die Berge :) |
Will be out in a minute, schöne Grüße retour! 😄 |
Description
When I use a malformed URL like
/soga/ibiza%
the app crashed with aI worked it around with the following portion in middleware.ts
It also reproducible on the demo Repos :D
Verifications
Mandatory reproduction URL
https://next-intl-bug-repro-app-router.vercel.app/en/asdafa%
Reproduction description
Steps to reproduce:
Expected behaviour
Returns a 404, like NextJS normally does.
The text was updated successfully, but these errors were encountered: