Skip to content

fix: validate EOF for chunked h1 responses#5307

Merged
mcollina merged 1 commit into
v7.xfrom
backport-5273-to-v7.x
May 18, 2026
Merged

fix: validate EOF for chunked h1 responses#5307
mcollina merged 1 commit into
v7.xfrom
backport-5273-to-v7.x

Conversation

@mcollina

Copy link
Copy Markdown
Member

This relates to...

Backport of #5273 to v7.x.

Rationale

This brings the HTTP/1.1 EOF validation fix for truncated chunked responses to the v7.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>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.44068% with 8 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.89%. Comparing base (301f347) to head (35efd5e).

Files with missing lines Patch % Lines
lib/dispatcher/client-h1.js 86.44% 8 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             v7.x    #5307   +/-   ##
=======================================
  Coverage   92.88%   92.89%           
=======================================
  Files         112      112           
  Lines       35785    35828   +43     
=======================================
+ Hits        33239    33281   +42     
- Misses       2546     2547    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@mcollina mcollina merged commit 2b3cd22 into v7.x May 18, 2026
57 of 62 checks passed
@mcollina mcollina deleted the backport-5273-to-v7.x branch May 18, 2026 17:32
@github-actions github-actions Bot mentioned this pull request May 25, 2026
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.

3 participants