Skip to content

fix: validate EOF for chunked h1 responses#5308

Merged
mcollina merged 2 commits into
v6.xfrom
backport-5273-to-v6.x
May 18, 2026
Merged

fix: validate EOF for chunked h1 responses#5308
mcollina merged 2 commits into
v6.xfrom
backport-5273-to-v6.x

Conversation

@mcollina
Copy link
Copy Markdown
Member

This relates to...

Backport of #5273 to v6.x.

Rationale

This brings the HTTP/1.1 EOF validation fix for truncated chunked responses to the v6.x line.

Changes

  • call parser.finish() on EOF / close paths instead of treating the response as complete
  • surface protocol errors for truncated chunked responses
  • add regression coverage for both Client and fetch

Features

N/A

Bug Fixes

  • reject truncated chunked HTTP/1.1 responses terminated by EOF

Breaking Changes and Deprecations

None

Status

(cherry picked from commit 13f6af6)
Signed-off-by: Matteo Collina <hello@matteocollina.com>
- replace t.assert usage with node:assert in websocket tests so they work on Node 18\n- reduce the disabled-limit payload size in permessage-deflate-limit to avoid CI timeouts\n- remove an extra blank line in lib/dispatcher/agent.js to satisfy standard

Signed-off-by: Matteo Collina <hello@matteocollina.com>
@mcollina mcollina merged commit 7917b25 into v6.x May 18, 2026
33 of 34 checks passed
@mcollina mcollina deleted the backport-5273-to-v6.x branch May 18, 2026 17:32
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.

2 participants