Commit eb4da0b
fix: reject hostnames exceeding 253 characters
Per RFC 1123, a hostname must not exceed 253 characters. The existing
validator only checked individual label length (≤63 chars via regex)
but never validated the total hostname length. This allowed hostnames
with multiple short labels separated by dots to pass validation even
when the total length exceeded 253 characters.
The fix adds an early length check after stripping port and IPv6
brackets, before proceeding with label/domain/IP validation.
Fixes #4131 parent 9bc7e82 commit eb4da0b
1 file changed
+14
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
113 | 113 | | |
114 | 114 | | |
115 | 115 | | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
116 | 130 | | |
117 | 131 | | |
118 | 132 | | |
| |||
0 commit comments