-
-
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
PatternUtils.formatPattern
replaces encoded space (%20) with +
#2407
Comments
Good catch. Do you want to put together a PR? |
Sure, not a problem. |
It's interesting that we only call |
In our application, we call |
You're right, we should be using I'd like to use
But that logic belongs in the history package (i.e. useQueries), not here. |
I have a route like this: <Route path="near/:city" component={StoresNear} /> In <h2>Stores near {this.props.params.city}</h2> I enter this URL into the address bar of the browser:
I then get this header:
If I change the URL to use a percent-encoded space
it works:
Question: I didn't want to create a new issue so I hope you guys don't mind me reviving this one. To me it feels like a bug that the plus symbol does not get decoded, but it might be a feature? I don't get it though because afaik, all servers will decode it to space... |
This is expected. |
@taion Ok, thanks for clearing that up. And Merry Christmas :) |
This line causes a URL parameter to be encoded in a non-reversible way: https://github.com/rackt/react-router/blob/v1.0.0-rc3/modules/PatternUtils.js#L170
We have an IIS server that doesn't correctly resolve URLs because of this behavior.
The change was introduced here: d955d7a
I'd like to know the reason that this behavior was introduced, as it's somewhat unexpected. To quote @mjackson:
I've not been able to find conclusive evidence in the URI spec, but considering that encoding and decoding should be symmetrical operations, this seems wrong. There is some discussion in this Stackoverflow thread.
Example:
The text was updated successfully, but these errors were encountered: