Skip to content

fix(retry): reject invalid resumed responses - #5724

Open
mcollina wants to merge 1 commit into
mainfrom
fix/retry-invalid-resume-response
Open

fix(retry): reject invalid resumed responses#5724
mcollina wants to merge 1 commit into
mainfrom
fix/retry-invalid-resume-response

Conversation

@mcollina

Copy link
Copy Markdown
Member

Summary

  • validate resumed responses before generic status-code retry handling
  • reject non-206 continuations after response bytes have already been forwarded
  • cover both throwOnError modes and verify that continuation bytes are not appended downstream

Rationale

Once a response has been partially consumed, a retry can only continue it with a valid 206 Partial Content response. Previously, responses with a status code of 300 or greater were handled before the continuation checks, allowing an invalid continuation body to be forwarded to the existing downstream stream.

Tests

  • npm run lint
  • node --test test/retry-handler.js test/retry-handler2.js test/retry-agent.js test/retry-handler-controller-proxy.js test/client-retry-resume-backpressure.js test/http2-goaway-retry-body.js (56 passed)
  • node --test test/issue-3934.js test/issue-5087.js test/issue-5137.js test/issue-3356.js test/issue-4691.js (8 passed)

@codecov-commenter

codecov-commenter commented Aug 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.47%. Comparing base (5033aa1) to head (a3618df).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5724   +/-   ##
=======================================
  Coverage   93.47%   93.47%           
=======================================
  Files         110      110           
  Lines       38906    38908    +2     
=======================================
+ Hits        36366    36368    +2     
  Misses       2540     2540           

☔ View full report in Codecov by Harness.
📢 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.

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