Skip to content

Commit

Permalink
Remove "!" character from the "unreserved" characters in IPv6 Zone ID…
Browse files Browse the repository at this point in the history
… parsing
  • Loading branch information
kenballus committed Jan 29, 2023
1 parent 96588e9 commit 29c4bcc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 1 addition & 0 deletions changelog/2899.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed '!' from _UNRESERVED_PAT as specified in the RFC.
4 changes: 1 addition & 3 deletions src/urllib3/util/url.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,7 @@
"(?:(?:%(hex)s:){0,6}%(hex)s)?::",
]

_UNRESERVED_PAT = (
r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._!\-~"
)
_UNRESERVED_PAT = r"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789._\-~"
_IPV6_PAT = "(?:" + "|".join([x % _subs for x in _variations]) + ")"
_ZONE_ID_PAT = "(?:%25|%)(?:[" + _UNRESERVED_PAT + "]|%[a-fA-F0-9]{2})+"
_IPV6_ADDRZ_PAT = r"\[" + _IPV6_PAT + r"(?:" + _ZONE_ID_PAT + r")?\]"
Expand Down

0 comments on commit 29c4bcc

Please sign in to comment.