Skip to content

Commit

Permalink
Remove location pathname decoding
Browse files Browse the repository at this point in the history
Fixes #505
  • Loading branch information
OliverJAsh authored and mjackson committed Mar 26, 2019
1 parent 8101f9f commit 78f016f
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions modules/LocationUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,21 +32,6 @@ export function createLocation(path, state, key, currentLocation) {
location.state = state;
}

try {
location.pathname = decodeURI(location.pathname);
} catch (e) {
if (e instanceof URIError) {
throw new URIError(
'Pathname "' +
location.pathname +
'" could not be decoded. ' +
'This is likely caused by an invalid percent-encoding.'
);
} else {
throw e;
}
}

if (key) location.key = key;

if (currentLocation) {
Expand Down

2 comments on commit 78f016f

@japrogramer
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to have this fix, I was told that it would be available in the next major release.
React Router v5 just came out and i tried updating and bug still exists.

@CrazyEraserUK
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1 🙏

Would love to have this fix shipped in a release pretty please folks!

Please sign in to comment.