Repository navigation
Commit 6534e5b
committed
fix(domain): match IDN TLDs against IANA list in IDNA-encoded form
With consider_tld=True, the TLD was looked up in the IANA list as
written. The list stores internationalized TLDs in their ASCII
(IDNA-encoded) form, so domains like пример.рф were rejected even
though their punycode form xn--e1afmkfd.xn--p1ai was accepted.
Encode the TLD before the lookup (falling back to the raw value
when IDNA encoding fails, so unencodable TLDs are still rejected
exactly like before). hostname() and url() pass consider_tld through
to domain(), so they pick up the fix as well.
Fixes #522
Co-authored-by: rahul05ranjan <11793455+rahul05ranjan@users.noreply.github.com>1 parent 6ffd862 commit 6534e5b
2 files changed
Lines changed: 16 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
79 | | - | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
80 | 89 | | |
81 | 90 | | |
82 | 91 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
50 | 54 | | |
51 | 55 | | |
52 | 56 | | |
| |||
100 | 104 | | |
101 | 105 | | |
102 | 106 | | |
| 107 | + | |
| 108 | + | |
103 | 109 | | |
104 | 110 | | |
105 | 111 | | |
| |||
0 commit comments