We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4eee16 commit 4a5d25cCopy full SHA for 4a5d25c
2 files changed
Lib/http/cookiejar.py
@@ -1032,10 +1032,13 @@ def set_ok_domain(self, cookie, request):
1032
if j == 0: # domain like .foo.bar
1033
tld = domain[i+1:]
1034
sld = domain[j+1:i]
1035
- if sld.lower() in ("co", "ac", "com", "edu", "org", "net",
1036
- "gov", "mil", "int", "aero", "biz", "cat", "coop",
1037
- "info", "jobs", "mobi", "museum", "name", "pro",
1038
- "travel", "eu") and len(tld) == 2:
+ known_slds = (
+ "co", "ac", "com", "edu", "org", "net",
+ "gov", "mil", "int", "aero", "biz", "cat", "coop",
+ "info", "jobs", "mobi", "museum", "name", "pro",
1039
+ "travel", "eu", "tv", "or", "nom", "sch", "web",
1040
+ )
1041
+ if sld.lower() in known_slds and len(tld) == 2:
1042
# domain like .co.uk
1043
_debug(" country-code second level domain %s", domain)
1044
return False
Misc/NEWS.d/next/Library/2025-06-22-16-29-10.gh-issue-135528.Rt_QhR.rst
@@ -0,0 +1 @@
1
+:mod:`http.cookiejar`: add "tv", "or", "nom", "sch", and "web" to the default list of supported country code second-level domains.
0 commit comments