Repository navigation
Conversation
Addressable::URI#query_values keeps a literal '+' in a parameter name as a plus, so Extended#normalized writes it as '%2B'. The next Addressable release reads it as a space, which changes normalized_url and with it the urlhash. These specs fail when that happens.
Extended#normalized built the normalized query from Addressable::URI#query_values, so the urlhash followed however Addressable reads a query. The next Addressable release reads '+' in a parameter name as a space, which would change the urlhash of every URL with such a name. Extended#query_values now splits and decodes the query itself, the way Addressable up to 2.9.2 does: '+' is a plus in a name and a space in a value. The output is the same for every Addressable version.
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.
Extended#normalizedbuilt the normalized query fromAddressable::URI#query_values, so the urlhash depended on how Addressable reads a query. The next Addressable release (2.10.0, sporkmonger/addressable#607) reads+in a parameter name as a space, as form encoding does. Every URL with a+in a parameter name would then get a newnormalized_urland urlhash:https://example.com/?a+b=cwould go from?a%2Bb=cto?a%20b=c.Changes
+in a parameter name stays a plus (%2Binnormalized_url),+in a value is a space, and%2Bis a plus in both. This includes the urlhash and legacy urlhash forhttps://example.com/?a+b=c. These specs fail against Addressablemainwithout the second commit.Extended#query_valuesparses the query itself, the way Addressable up to 2.9.2 does, so the urlhash no longer depends on the Addressable version. The blacklist check uses the same name decoding.Not covered
callable_urlis still Addressable's normalized URL, so it changes with 2.10.0 in a few cases. Addressable no longer decodes a pct-encoded delimiter in a way that changes the URL's meaning:?a=%252Bstays?a=%252Binstead of becoming?a=%2B, and?a%3Db=1stays as it is instead of becoming?a=b=1. The urlhash isn't affected.