Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
gh-105708: 'V' could be case insensitive for IPvFuture hostnames
  • Loading branch information
csreddy98 authored and orsenthil committed Jul 5, 2026
commit d140752e5bdd5606115cc5596c3b5e9eef909f41
4 changes: 2 additions & 2 deletions Lib/urllib/parse.py
Original file line number Diff line number Diff line change
Expand Up @@ -544,8 +544,8 @@ def _check_bracketed_netloc(netloc):
# Valid bracketed hosts are defined in
# https://www.rfc-editor.org/rfc/rfc3986#page-49 and https://url.spec.whatwg.org/
def _check_bracketed_host(hostname):
if hostname.startswith('v'):
if not re.match(r"\Av[a-fA-F0-9]+\..+\z", hostname):
if hostname[0].lower() == 'v':
if not re.match(r"\A[vV][a-fA-F0-9]+\..+\Z", hostname):
raise ValueError(f"IPvFuture address is invalid")
else:
ip = ipaddress.ip_address(hostname) # Throws Value Error if not IPv6 or IPv4
Expand Down