-
Notifications
You must be signed in to change notification settings - Fork 3k
Slashes are double encoded in hash query params #1973
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
Comments
I've actually found that ui-router is transitioning twice on this link. If I don't have a slash in the query param, it transitions once. But once I add the slash it does two transitions, one immediately after the other. The first transition gets the correct param, and the second is double encoded. This invokes my controller twice as well. |
I've also found that if you provide a direct url like |
This is related to #1645. Before 0.2.14 the issue was more cosmetic but with the addition of the I have created a failing test for it.
Previously the test did have assertions for decoding. Solution 1Have the
Solution 2Update |
Unfortunately, it seems it's not fixed. My configuration
It should match: However, the optional back slash is encoded when you go to and url becomes: After some investigation I found the script is not decoded because the back slash is double encoded: First of all, there is the following code:
This code launches the re-defined Then the string is double encoded here: Therefore it becomes I managed to fix it this way:
replaced with
and
replaced with
I'm not quite familiar with ui-router so I don't know if this solution is correct but it fixes my case. |
Update: Unfortunately, my fix is incomplete.
Could anybody (@eddiemonge @nateabele @christopherthielen @ksperling @timkindberg @PascalPrecht) take a look at the issue? It's been a while since this issue was reported but it is still even does not have the bug label assigned. Did you, guys, miss it accidentally? |
I am going to close this as a duplicate of #1645 and if fixing that doesn't fix this then I'll reopen it. |
I have a link that's something like
Which results in the hash-url
#/my-state?path=%252Ffoo
. The slash being encoded to%2F
and the percent being encoded to%25
. In0.2.13
this double-encoding seemed to work fine, as the new state picks it up correctly (as/foo
), but in0.2.14
and0.2.15
the new state will only get it decoded once, resulting in%2Ffoo
.The text was updated successfully, but these errors were encountered: