-
Notifications
You must be signed in to change notification settings - Fork 961
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
decodeUri the path breaks encoding #551
Comments
I too am having the same issue. It looks like the bug is happening because of this line: https://github.com/ReactTraining/history/blob/master/modules/LocationUtils.js#L35 . Any chance we can fix this? Right now there is no front end solution to mitigate for this. Thanks! |
I'm running into the same issue here and I imagine many others are too whether they know it or not. There's a real legitimate need to maintain encoding as we may need to escape user input. A common scenario is when passing along a user-entered search query that contains an ampersand. For example, |
@mjackson Looking for some guidance or a fix here. Also happy to contribute a fix if you can provide guidance on how it should be addressed. |
I'm pretty sure this is a dup of #505. Let's please only discuss in one spot, thanks! (Happy to re-open if it's not a duplicate) |
I'm given an ID that I need to put in the url, so I call encodeURIComponent on it to make it sure its safe, then decodeURIComponent to get the original ID back. The IDs are coming from a server that I can't control.
One of the IDs has a
instead of the original
%20
in it, when I encodeURIComponent it becomes%2520
. When that route is pushed to history the pathname is set calling decodeURI on the path which turns it back to%20
. Calling decodeURIComponent on it then returns%20
so it no longer matches the id.The text was updated successfully, but these errors were encountered: