Repository navigation
fix(http): accept IPv6 loopback Host headers - #172
Conversation
@greptile review |
[Medium impact] This PR appears safe to merge; no actionable issues remain. SummaryThis PR accepts bracketed IPv6 loopback addresses in
Both earlier, unnumbered findings are addressed: empty suffixes are rejected, and the listener test compares decoded JSON instead of exact response bytes. Reviews (3) · Last reviewed commit: "fix(http): reject malformed Host authori..." · Reviewed by Greptile |
@greptile review |
160f807 to
d2ed3c5
Compare
|
Thanks @0xbrayo. I checked the authority parser against hostile inputs by running the same regex + urlsplit logic standalone, and every one of these is rejected: |
d2ed3c5 to
946629c
Compare
@greptile review |
Closes #92.
Parse Host headers as authorities so
[::1]and[::1]:5600reach the API instead of being rejected with HTTP 400. Allow IPv6 loopback alongside localhost and IPv4 loopback, retain configured-host matching, and reject malformed authority syntax, empty suffixes, invalid ports, userinfo, and URL path/query/fragment components.Add Host-header regressions and a real HTTP request over an IPv6 loopback listener, with an explicit skip when IPv6 is unavailable. Document
aw-server --host ::1, since a default localhost bind can resolve to IPv4 only. Include the new tests inmake testfor Windows, Linux, and macOS CI.Validation: 75 tests passed locally, including the live IPv6 listener test; Ruff, Black, mypy, and
git diff --checkpassed. The IPv6 tests reproduce HTTP 400 against the original code. All 75 tests also pass on Windows, Linux, and macOS CI, including the live IPv6 test on Windows.