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
The general question that arises is, do you support escaped percentages as path names, or, why wouldn't you support them? As far as I understand, it is totally a valid character (if escaped) or am I wrong here?
jamescazzetta
changed the title
[Bug]: encoded percentages in pathname get falsely decoded router's navigate(obj)
[Bug]: encoded percentages in pathname get incorrectly decoded within router's navigate(obj)Mar 16, 2023
I am also having the issue.
In my case, the url is formed with the pattern /user/:userId.
The userId has a value of %a.
When encoded in the url I have /user/%25a.
This generates an error because react-router seems to decode it twice meaning it does a first pass and obtains /user/%a then it does it a second time and it fails because %a is, of course, a bad encoding.
What version of React Router are you using?
6.8.0
Steps to Reproduce
I am using
createBrowserRouter
to prohibit certain calls from happening, and when I doTo reproduce, pass an object to to like the following:
{ pathname: 'ABC/TEST%257FAB' }
the percentage in the pathname is encoded (%25) and it seems that the component being initialized ends up with incorrect props.params.
Expected Behavior
Actual Behavior
The text was updated successfully, but these errors were encountered: