Repository navigation
Commit b38eefa
Reject IDN labels that start or end with a hyphen
domain() rejects "-bucher.de" and "bucher-.de", but accepted the same names
once the label holds a non-ASCII character:
domain("-bücher.de") # True
domain("bücher-.de") # True
The hyphen rule is applied to the encoded name, where such a label has become
"xn---bcher-4ya" and starts with "x". RFC 5891 (4.2.3.1) does not allow a
label to start or end with a hyphen, so the labels are now checked before
they are encoded.
Verdicts change only for labels that contain a non-ASCII character and have a
hyphen at either end (checked against master on 60,000 generated names);
hostname(), email() and url() follow through domain().
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>1 parent 22786cc commit b38eefa
2 files changed
Lines changed: 34 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
237 | 237 | | |
238 | 238 | | |
239 | 239 | | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
0 commit comments