Repository navigation
Preserve explicit empty URL queries - #211
Open
Aschenbath wants to merge 1 commit into
Open
Aschenbath wants to merge 1 commit into
Aschenbath wants to merge 1 commit into
Conversation
Keep absent and empty queries distinct during parsing and rendering so relative references can clear an inherited query. Cover URL and DecodedURL round trips, query operations, and reference resolution. Fixes python-hyper#207
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.
Resolving
?againsthttp://example.com/path?x=1currently retainsx=1. Parsing and rendering also discard an explicit empty query, losing the distinction required by RFC 3986 section 5.2.2.Preserve an empty query as one empty key without a value,
(("", None),), consistent with the existing representation of empty ampersand-separated query fields. Render the query separator whenever query fields are present. The existing relative-resolution logic then replaces the base query correctly. The query property documentation describes the representation; no new constructor arguments are needed.Fixes #207.
Validation on Windows / CPython 3.9.25, using the repository-pinned test and lint tools:
test_hostnames_ascii_noleadfiltering health check tracked by Tests are failing due to hypothesis filtering #186; no health checks were suppressed.check-manifest, source/wheel builds, and Twine checks pass. The docs build succeeds with five warnings in unchanged configuration/docstrings; Twine retains the existing content-type warning.AI assistance was used for investigation, implementation, testing, and this description. No human review or hosted CI result is claimed.