Skip to content

Frame SocketClient response body correctly#149

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

Frame SocketClient response body correctly#149
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/socket-client-body-framing

Conversation

@kevinresol

Copy link
Copy Markdown
Member

SocketClient framed the response body by Content-Length and, whenever Content-Length was absent, unconditionally ran the body through Chunked.decode. That corrupts responses that are neither chunked nor length-delimited (HTTP/1.1 allows the body to be delimited by connection close).

Framing now follows RFC 7230 §3.3.3 order:

  1. Transfer-Encoding contains chunked (case-insensitive) → Chunked.decode
  2. otherwise Content-Length present → limit to that length
  3. otherwise → read the remaining source until the connection closes

Made with Cursor

…, then close

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