percent-encode ? and # in url pattern canonicalize_pathname#1172
Open
Arawoof06 wants to merge 1 commit into
Open
percent-encode ? and # in url pattern canonicalize_pathname#1172Arawoof06 wants to merge 1 commit into
Arawoof06 wants to merge 1 commit into
Conversation
Codecov Report❌ Patch coverage is
❌ Your patch check has failed because the patch coverage (27.27%) is below the target coverage (80.00%). You can increase the patch coverage or adjust the target coverage. Additional details and impacted files@@ Coverage Diff @@
## main #1172 +/- ##
==========================================
- Coverage 59.79% 59.76% -0.03%
==========================================
Files 37 37
Lines 6121 6122 +1
Branches 2978 2979 +1
==========================================
- Hits 3660 3659 -1
Misses 618 618
- Partials 1843 1845 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
anonrig
approved these changes
Jul 10, 2026
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.
canonicalize_pathname concatenates the component value into a
fake://fake-url...string and runs the full basic url parser, but the url pattern spec canonicalizes a pathname with the path in state override, where?and#are ordinary path code points that percent-encode rather than starting the query or fragment. without state override a literal?or#ended the path early, sonew URLPattern({pathname: "/a\\?b"})compiled to match/ainstead of/a%3Fb, a broader match than written; leading and trailing c0-control-or-space was stripped too. route the value through set_pathname, which runs path state override, matching how canonicalize_hostname already uses set_hostname. added a regression test.