Repository navigation
fix(fetch): close the connection when a null body status response has content - #6218
Merged
Merged
Conversation
… content A 205 response must not carry content, but HTTP/1.1 framing still allows a body, and fetch disregards it. Instead of keeping the connection busy until the server finishes sending content nobody can read, abort the dispatch as soon as content arrives. 205 responses without content keep reusing the connection.
ronag
approved these changes
Nov 17, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #6218 +/- ##
==========================================
+ Coverage 91.61% 91.68% +0.06%
==========================================
Files 113 113
Lines 44044 44481 +437
==========================================
+ Hits 40351 40781 +430
- Misses 3693 3700 +7 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A 205 (Reset Content) response must not carry content, but HTTP/1.1 framing still allows one (RFC 9112 §6.3 only makes HEAD, 1xx, 204 and 304 responses end at the headers), so llhttp correctly parses a body when the server sends
Transfer-Encoding: chunkedor a non-zeroContent-Length. Fetch exposes these responses with a null body and silently drained the content, so a server that never finished the body kept the connection busy untilbodyTimeout, and the caller had no body stream to cancel.When content arrives on a null-body-status response, fetch now aborts the dispatch, which closes the connection, and ignores the resulting error because the response has already been delivered without a body. A 205 without content keeps reusing the connection.