Skip to content

Include non-default port in auto-injected Host header (SocketClient)#152

Merged
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/socket-client-host-port
Jul 13, 2026
Merged

Include non-default port in auto-injected Host header (SocketClient)#152
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/socket-client-host-port

Conversation

@kevinresol

Copy link
Copy Markdown
Member

When SocketClient auto-injects a Host header it used only the hostname, dropping any non-default port. A request to e.g. http://example.com:8080/ would send Host: example.com, which is incorrect per RFC 7230 §5.4.

The injected Host value now includes the port when it is present and non-default for the scheme (i.e. not 80 for http / 443 for https), e.g. Host: example.com:8080.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol merged commit dfd84ce into haxetink:master Jul 13, 2026
8 of 15 checks passed
@kevinresol
kevinresol deleted the fix/socket-client-host-port branch July 14, 2026 05:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant