|
| 1 | + |
1 | 2 | r"""HTTP cookie handling for web clients. |
2 | 3 |
|
3 | 4 | This module has (now fairly distant) origins in Gisle Aas' Perl module |
@@ -1032,10 +1033,13 @@ def set_ok_domain(self, cookie, request): |
1032 | 1033 | if j == 0: # domain like .foo.bar |
1033 | 1034 | tld = domain[i+1:] |
1034 | 1035 | 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: |
| 1036 | + known_slds = ( |
| 1037 | + "co", "ac", "com", "edu", "org", "net", |
| 1038 | + "gov", "mil", "int", "aero", "biz", "cat", "coop", |
| 1039 | + "info", "jobs", "mobi", "museum", "name", "pro", |
| 1040 | + "travel", "eu", "tv", "or", "nom", "sch", "web", |
| 1041 | + ) |
| 1042 | + if sld.lower() in known_slds and len(tld) == 2: |
1039 | 1043 | # domain like .co.uk |
1040 | 1044 | _debug(" country-code second level domain %s", domain) |
1041 | 1045 | return False |
|
0 commit comments