Skip to content

Commit 57fca8b

Browse files
authored
Update cookiejar.py
1 parent befc9e2 commit 57fca8b

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

Lib/http/cookiejar.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -535,7 +535,7 @@ def parse_ns_headers(ns_headers):
535535
# only kept for backwards compatibilty.
536536
IPV4_RE = re.compile(r"\.\d+$", re.ASCII)
537537

538-
def is_ip_like(text: str):
538+
def is_ip_like_hostname(text: str):
539539
"""Return True if text is a valid hostname in the form of IP address."""
540540
from ipaddress import IPv4Address, IPv6Address
541541
# check for IPv4 address
@@ -556,7 +556,7 @@ def is_HDN(text):
556556
# XXX
557557
# This may well be wrong. Which RFC is HDN defined in, if any (for
558558
# the purposes of RFC 2965)?
559-
if is_ip_like(text):
559+
if is_ip_like_hostname(text):
560560
return False
561561
if text == "":
562562
return False
@@ -609,7 +609,7 @@ def liberal_is_HDN(text):
609609
For accepting/blocking domains.
610610
611611
"""
612-
return not is_ip_like(text)
612+
return not is_ip_like_hostname(text)
613613

614614
def user_domain_match(A, B):
615615
"""For blocking/accepting domains.

0 commit comments

Comments
 (0)