Commit d941579
committed
fix: never run IDN canonicalization on bracketed IP literals
A bracketed host with a malformed zone identifier (e.g. [fe80::1%25]) is
not an IP per parse, so canonicalizeHost fell through to the WHATWG
fallback. Node >= 18 throws there (fail-closed), but Node 16's URL parser
accepts the input and .hostname strips the brackets, truncating the
malformed literal. Skip hosts starting with '[' — IDN conversion only
applies to reg-names.1 parent c0f0279 commit d941579
1 file changed
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
351 | 351 | | |
352 | 352 | | |
353 | 353 | | |
| 354 | + | |
354 | 355 | | |
355 | 356 | | |
356 | 357 | | |
| |||
0 commit comments