fix(http1): fix handling of 204/304 responses - #5864
Merged
Merged
Conversation
204/304 responses don't have a payload but they may have `Content-Length`. Deliver the response but close the connection (unless it's a `HEAD` request). Signed-off-by: James M Snell <jasnell@gmail.com>
jasnell
marked this pull request as ready for review
September 23, 2026 03:55
jasnell
commented
Sep 23, 2026
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #5864 +/- ##
==========================================
- Coverage 93.85% 93.84% -0.02%
==========================================
Files 110 110
Lines 39879 39891 +12
==========================================
+ Hits 37428 37435 +7
- Misses 2451 2456 +5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
metcoder95
reviewed
Sep 23, 2026
metcoder95
left a comment
Member
There was a problem hiding this comment.
lgtm. The change on the behavior seems reasonable as we align with a spec
metcoder95
approved these changes
Sep 23, 2026
3 tasks
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.
This relates to...
HTTP1
Rationale
204/304 responses don't have a payload but they may have
Content-Length. Deliver the response but close the connection (unless it's aHEADrequest).Better match for RFC 9112 and RFC 9110.
Looks like #5816 did something similar for H2.
#5505 and #5516 are likely relevant here.
Spotted while doing an audit of the implementation.
Changes
204/304 responses with a
Content-Lengthdo not error but the connection is still dropped.Features
N/A
Bug Fixes
Searched but didn't find specific reports.
Breaking Changes and Deprecations
Should be determined if this is technically breaking.
Status