http-netty: don't send a payload body or trailers in responses to HEAD #3693
All Vouch review confidence checks passed
Residual risk 0.24 = Change Risk (0.60) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.60 · 211 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.320
Shallow Review Depth
shallow_review_depth
0.289
Sensitive Paths
sensitive_paths
0.060
Real PR Conversation Timeline
1 comments
"Review active on #3693"
general
weight: 0.35
idelpivnitskiy
Motivation
A server must not send a payload body or trailers in a response to a HEAD request (RFC 7231, section 4.3.2), but a handler that reuses its GET logic for HEAD returns them anyway. HTTP/1.1 already discards them. HTTP/2 had no such check and wrote a
DATAframe with the body followed by a trailersHEADERSframe. Strict clients such as curl treat that as a protocol error and close the whole connection withGOAWAY, not just the one stream.Modifications
Result
A handler that returns a body or trailers for a HEAD request no longer breaks HTTP/2 connections: the client gets the response headers followed by an empty
DATAframe withEND_STREAM. Packet captures of such a handler before and after the change show the leakedDATAand trailers frames gone and HTTP/1.1 output unchanged.Behavior change: services whose handlers return a payload body or trailers for a HEAD request over HTTP/2 now have them dropped instead of sent. Headers, including any
Content-Lengththe handler sets, are unchanged, so no action is needed.