You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Go to any site using react-router-dom, and enter an erroneous percent sign somewhere in the URL.
Expected Behavior
React router catches the error from decodeURI, doesn't crash, and continues normally by disregarding the percent sign.
Actual Behavior
React Router does not catch the error, and crashes the entire app, causing it to unmount (even when there are error boundaries).
The error:
PathUtils.js:37: Uncaught URIError: URI malformed
at decodeURI (<anonymous>)
at e.parsePath (PathUtils.js:37)
at x (createBrowserHistory.js:79)
at g (createBrowserHistory.js:152)
at new e (BrowserRouter.js:42)
at p._constructComponentWithoutOwner (ReactCompositeComponent.js:298)
at p._constructComponent (ReactCompositeComponent.js:285)
at p.mountComponent (ReactCompositeComponent.js:188)
at Object.mountComponent (ReactReconciler.js:46)
at performInitialMount (ReactCompositeComponent.js:371)
The text was updated successfully, but these errors were encountered:
ginkoid
changed the title
Putting a % in a url without proper url encoding crashes React Router Dom.
Putting a % in a url without proper url encoding crashes React Router Dom
Jan 1, 2018
Version
4.1.1
Test Case
Go to reacttraining.com/react-router/web/guides/philosophy%, and inspect the error in the browser console.
Steps to reproduce
Go to any site using
react-router-dom
, and enter an erroneous percent sign somewhere in the URL.Expected Behavior
React router catches the error from
decodeURI
, doesn't crash, and continues normally by disregarding the percent sign.Actual Behavior
React Router does not catch the error, and crashes the entire app, causing it to unmount (even when there are error boundaries).
The error:
The text was updated successfully, but these errors were encountered: