-
-
Notifications
You must be signed in to change notification settings - Fork 10.7k
Closed
Labels
Milestone
Description
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:
Apparently + is a special character in query strings, but not in the path portion of the URL.
#716 (comment)
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:
var placeName = 'Laguna Beach';
var uri = formatPattern('/place/:placeName', { placeName: placeName });
decodeURI(uri);
// -> "/place/Laguna+Beach"
// Expected decoded URI would be "/place/Laguna Beach".