-
Notifications
You must be signed in to change notification settings - Fork 959
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 in code breaks my encoded URLs #745
Comments
I'm working also with problems related to decodeURI. The commit for undoing changes stated in the message
Now the question is, what is expected to happen and when? Is it best to fallback to using version 4.9.0 where this change was introduced? @vass-david link to 78f016 commit |
We have this problem too, links where we need to have |
I think it should be |
This problem is pretty thoroughly discusses in #505 with possible solutions and workarounds, and what possible issues they might cause and why they might not be applicable in some specific cases. Please see that thread. We probably don't need another topic for that :) The discussion related to the problem has been ongoing for at least two years. I think the real question is that why the fix to this issue was apparently taken out once it got introduced? Was there still something unexpected? And is it probable that there will be a fix-it-once-and-for all-solution or does every app just need their own work around to overcome this? |
Thanks for the reference to #505, it looks like the solution was to stop decoding URLs. There was a PR merged #656 removing decoding, but then it was reverted to prepare a release from |
Also there was a bug earlier with params not being decoded. Is it a norm right now for them not to be decoded? |
Here's a simple reproduction showing at least two bugs: https://codesandbox.io/s/heuristic-sun-revzx?file=/src/App.js
|
Link to code that causes issues: https://github.com/ReactTraining/history/blob/7b8ab30f98855c31e74eb72f2592a8fff9d7d3ac/modules/LocationUtils.js#L36
I found that there were some issues raised a long while ago, but it seems that recently this has became an issue again.
My use case:
I'm receiving object names from API which are created by user. I can't control what's coming and I don't want to limit users from using special characters in their names. But even if I call
encodeURIComponent
on the name of an object, url will be decoded anyway and a user is navigated to wrong/faulty URL.It's hard to tell what's the reason of
decodeURI
part of code, since commit name is "Undo changes from 78f016 and 0fe9cb" but github search wasn't able to find commits78f016
or0fe9cb
Thanks for help
The text was updated successfully, but these errors were encountered: