Skip to content
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

Partially encoded parameter #5472

Closed
edbentley opened this issue Aug 28, 2017 · 1 comment
Closed

Partially encoded parameter #5472

edbentley opened this issue Aug 28, 2017 · 1 comment

Comments

@edbentley
Copy link

Version

4.2.0

Test Case

https://codesandbox.io/s/qxv30r58m6

Steps to reproduce

  1. My app has an id string that is partially encoded, e.g. id//github%2Fissues
  2. I encode this (using encodeURIComponent) to id%2F%2Fgithub%252Fissues in the URL.
    <Link to='/id%2F%2Fgithub%252Fissues'>link</Link>
    It is still encoded in the address bar.
  3. Use a path of /:id
  4. I then receive this back as parameter match.params.id which when printed out is id%2F%2Fgithub%2Fissues (note %252F has become %2F - looks like decodeURI was run on it)
  5. I decode it (using decodeURIComponent) and get id//github/issues back

Expected: id//github%2Fissues
Actual: id//github/issues

I was using koa router and this worked as expected, but refactoring to react router is causing this issue. Can this be fixed, or is there a way to disable what looks like decodeURI in step 4? I cannot get my original id back.

@timdorr
Copy link
Member

timdorr commented Aug 28, 2017

Related to #5474.
Duplicate of remix-run/history#505.

@timdorr timdorr closed this as completed Aug 28, 2017
@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants