Repository navigation
Fix Host header port and blame for invalid target names - #301
Merged
Merged
Conversation
Closes #300 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVmJ6btzu5tQgxccHb1SoS
…ver Host headers (#300) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RVmJ6btzu5tQgxccHb1SoS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this change?
Closes #300
netio.http_requestsends the port in theHostheader when it isn't the scheme's default (IPv6 literals in brackets); the same port value is used for the connection and the header.valid_hostnameinserver/http.py): empty or over-long IDNA labels, names over 255 bytes, spaces and control characters get a 502 without counting against any proxy and without touching the pool.Hostheader and forwarded request line bracket IPv6 literals (reusingnetio.host_header).How was it tested?
python3 -m pytestpasses (1036 passed, 3 skipped)ruff check .is cleantests/test_bad_hosts_and_host_header.pystarts a local server and checks theHostheader, and sendsCONNECT example..com:443through a pool of three SOCKS5 proxies – before the fix they were disabled, nowfail == 0for all.Screenshots
n/a
🤖 Generated with Claude Code
https://claude.ai/code/session_01RVmJ6btzu5tQgxccHb1SoS