Commit 5c959b8
committed
fix(domain): accept single-label TLDs rejected by multi-label-only regex
domain() and hostname() with rfc_1034=True silently rejected valid
single-label domain names (ie, com, yu, ie.) because the regex used a
+ quantifier on the label group, requiring at least one dot.
RFC 1034 s2.3.1 permits single-label names. Add a second match path
for bare TLDs (2-63 alpha chars, optional trailing dot) after the
existing multi-label path so that both cases are handled.
Fixes #4421 parent 70de324 commit 5c959b8
1 file changed
Lines changed: 22 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
54 | 59 | | |
55 | 60 | | |
56 | 61 | | |
| |||
82 | 87 | | |
83 | 88 | | |
84 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
85 | 94 | | |
86 | | - | |
| 95 | + | |
| 96 | + | |
87 | 97 | | |
88 | 98 | | |
89 | 99 | | |
| |||
94 | 104 | | |
95 | 105 | | |
96 | 106 | | |
97 | | - | |
| 107 | + | |
98 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
99 | 118 | | |
| 119 | + | |
100 | 120 | | |
101 | 121 | | |
0 commit comments