Skip to content

Add Host header and frame response body in TcpClient#150

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

Add Host header and frame response body in TcpClient#150
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/tcp-client-host-framing

Conversation

@kevinresol

Copy link
Copy Markdown
Member

TcpClient never sent a Host header (mandatory for HTTP/1.1, RFC 7230 §5.4) and returned the raw connection source as the response body without any framing.

  • Inject a Host header when the request does not already have one, including the port when it is non-default for the scheme (e.g. example.com:8080).
  • Frame the response body the same way as SocketClient: chunked Transfer-Encoding (case-insensitive) → Chunked.decode, else Content-Length → limit, else read until the connection closes.

Connection reuse is intentionally left out of scope (the connection is still closed after each request).

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol merged commit e3aae88 into haxetink:master Jul 13, 2026
7 of 15 checks passed
@kevinresol
kevinresol deleted the fix/tcp-client-host-framing 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