-
Notifications
You must be signed in to change notification settings - Fork 27.4k
fix($location): always decode special chars in $location.url(value)
#16354
fix($location): always decode special chars in $location.url(value)
#16354
Conversation
I have to admit that I don't really understand what we are trying to fix here. I think a bit more info in the commit message would be useful. 😅 |
I have updated the commit message @Narretz |
ab1c9fd
to
75abea7
Compare
Thanks! That should help in the future. There were a few typos, here's a cleaned up version:
|
Thanks updated again. Still looking for confirmation from @bourey |
75abea7
to
4ba291d
Compare
FWIW, the ui-router test suite fails with this build. I'll look into what's breaking. edit: the test suite is failing due to an unrelated change |
$location.url(value)
I am going to land this in 1.6.x and then see if @bourey comes back with a further issue. |
The original fix for angular#16312 included changing how `$location.url(value)` decoded the special characters passed to it as a setter. This broke a number of use cases (mostly involving the ui-router). Further analysis appears to show that we can solve angular#16312, to prevent urls being rewritten with decoded values, without modifying the behaviour of `$location.url`. This commit reverts changes to `$location.url(value)` so that encoded chars will once again be decoded and passed to `$location.path(value)`. In particular it will convert encoded forward slashes, which changes how the path is updated, since e.g. `a/b/%2Fc%2Fd` will become `a/b/c/d`. While this is arguably not "correct", it appears that there are too many use cases relying upon this behaviour.
4ba291d
to
9284bf5
Compare
See #16312 (comment)
@bourey - can you check that with this regression fix your original issue is still resolved?