summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Lib/http/cookiejar.py2
-rw-r--r--Misc/NEWS.d/next/Library/2022-12-24-16-39-53.gh-issue-100519.G_dZLP.rst2
2 files changed, 3 insertions, 1 deletions
diff --git a/Lib/http/cookiejar.py b/Lib/http/cookiejar.py
index e3df007..93b10d2 100644
--- a/Lib/http/cookiejar.py
+++ b/Lib/http/cookiejar.py
@@ -640,7 +640,7 @@ def eff_request_host(request):
"""
erhn = req_host = request_host(request)
- if req_host.find(".") == -1 and not IPV4_RE.search(req_host):
+ if "." not in req_host:
erhn = req_host + ".local"
return req_host, erhn
diff --git a/Misc/NEWS.d/next/Library/2022-12-24-16-39-53.gh-issue-100519.G_dZLP.rst b/Misc/NEWS.d/next/Library/2022-12-24-16-39-53.gh-issue-100519.G_dZLP.rst
new file mode 100644
index 0000000..6b889b6
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2022-12-24-16-39-53.gh-issue-100519.G_dZLP.rst
@@ -0,0 +1,2 @@
+Small simplification of :func:`http.cookiejar.eff_request_host` that
+improves readability and better matches the RFC wording.