[backport] PR #8212 to 5.0 - do not overencode unhashed states#8217
Merged
[backport] PR #8212 to 5.0 - do not overencode unhashed states#8217
Conversation
--------- **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][1]. Because of this, angular's `$location.search()` function uses a function internally called `encodeUriQuery()` to mimic the browser behavior before updating `location.href`. To bring the same funtionality to the `unhashUrl()` function, the `encodeUriQuery()` was extracted into it's own package and used as the escape handler for `querystring.stringify()` [1]: https://www.ietf.org/rfc/rfc3986.txt * Original sha: d9dac3f * Authored by spalger <spalger@users.noreply.github.com> on 2016-09-09T22:39:57Z
alexwizp
added a commit
to alexwizp/kibana
that referenced
this pull request
Sep 13, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Backport PR #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-pcharcharacters 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()