-
-
Notifications
You must be signed in to change notification settings - Fork 10.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
An invalid URI will make react-router crash #3507
Comments
This error is thrown by the |
Yes, that's one of the two cases. The second case, when the pathname is invalid, the error is thrown in react routers PatternUtils using decodeURIComponent |
You can provide your own query string parsing methods, which can work around this. It's really an upstream issue with |
Ok, i'll do that. But it still breaks in react-routers own library @ https://github.com/reactjs/react-router/blob/master/modules/PatternUtils.js#L120 not related to May not be a case if you take care of this server side, but it's still breaks on client side. |
Alternatively, catch the error and hit the error callback, as with #3453 – we'd be happy to accept a PR that does that (if it works, &c.) |
Version
2.4.0
Test Case
http://codepen.io/anon/pen/VjYREm
Steps to reproduce
Use any non-valid UTF-8-encoded character sequence in the URI
Expected Behavior
This one is hard. I think you want react-router just to ignore the faulty values
Actual Behavior
react-router crashes making your site crash
The text was updated successfully, but these errors were encountered: