Skip to content

Support chunk extensions in chunked decoder#146

Merged
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/chunked-chunk-ext
Jul 13, 2026
Merged

Support chunk extensions in chunked decoder#146
kevinresol merged 1 commit into
haxetink:masterfrom
kevinresol:fix/chunked-chunk-ext

Conversation

@kevinresol

Copy link
Copy Markdown
Member

The chunked decoder parsed the whole chunk-size line as a hex number, so a valid chunk header carrying a chunk extension (e.g. 3;foo=bar, RFC 7230 §4.1.1) was fed to Std.parseInt as 0x3;foo=bar and failed to decode.

  • Strip the optional chunk extension (everything from the first ;) before parsing the hex size.
  • Reject invalid/empty sizes with a parse error instead of silently producing a bad state.

Added TestChunked decode variants covering 3;foo=bar and extensions on the terminating 0 chunk.

Made with Cursor

Co-authored-by: Cursor <cursoragent@cursor.com>
@kevinresol
kevinresol force-pushed the fix/chunked-chunk-ext branch from c4626a4 to 0890ea2 Compare July 13, 2026 12:05
@kevinresol

Copy link
Copy Markdown
Member Author

Addressed review: switched Std.string(v) to v.toString() in the chunked decoder. Also rebased onto latest master to keep the PR clean.

@kevinresol
kevinresol merged commit 333f73a into haxetink:master Jul 13, 2026
7 of 14 checks passed
@kevinresol
kevinresol deleted the fix/chunked-chunk-ext 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