Closed cmaerz closed 1 month ago
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 /[locale]
where it tries to extract a segment from the pathname.
I've set up https://github.com/amannn/next-intl/pull/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.