You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 0fac6f8
Browse filesBrowse the repository at this point in the historyBrowse files
Apply the private flag to IPv6 hosts in hostname() and url()
hostname() and url() document `private` as "Embedded IP address is public if
False, private/local if True", but only passed the flag to ipv4(). Every IPv6
literal therefore passed, whatever the value of the flag:
url("http://127.0.0.1/", private=False) # ValidationError
url("http://[::1]/", private=False) # True
url("http://[::ffff:127.0.0.1]/", private=False) # True
url("http://[fd00::1]/", private=False) # True
ipv6() gets a `private` parameter and hostname() passes the flag on. The IPv4
behaviour is not touched: _check_private_ip() is unchanged, and the IPv6 check
uses the counterparts of the ranges it already treats as private (unspecified,
loopback, unique local, link-local, site-local, multicast). An IPv4-mapped
address is judged by the IPv4 address it embeds, with the existing function.
This is the single pull request asked for when #451, #452 and #453 were
closed. See discussion #591.
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
0 commit comments