[4.6] do not overencode unhashed states #9752
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Backports #8212
Commit 1:
[state/unhashUrl] use encode-uri-query to generate cleanly encoded urls
By default, the url.format function stringifies the query object and encodes each parameter with
encodeURIComponent()
. This is effective, but does not match the native browser behavior, which is to only encode the non-pchar
characters as defined by rfc3986. Because of this, angular's$location.search()
function uses a function internally calledencodeUriQuery()
to mimic the browser behavior before updatinglocation.href
.To bring the same funtionality to the
unhashUrl()
function, theencodeUriQuery()
was extracted into it's own package and used as the escape handler forquerystring.stringify()