Repository navigation
Conversation
Carry the request method through response mapping and use an exact body length of zero for HEAD responses. Their Content-Length describes the corresponding GET representation, not the bytes in the response body. Preserve the response header and receive stream so delayed completion and trailers remain observable. Cover immediate completion, empty DATA, trailers, missing Content-Length, and a GET response as a control.
shuvroroy
marked this pull request as ready for review
October 18, 2026 12:31
This branch has not been deployed
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.
An HTTP/2 HEAD response with
Content-Length: 5currently exposes a body size hint ofSome(5), even though HEAD responses contain no body bytes. This can mislead consumers that use size hints for allocation or body limits.Carry the HEAD request flag into response mapping and give its incoming body an exact length of zero. Preserve the original Content-Length header and receive stream, including delayed completion and trailers.
The regression covers headers with END_STREAM, delayed empty DATA, trailers, a response without Content-Length, and a GET control. It fails on master with
Some(5)instead ofSome(0)and passes with this change.Validation:
cargo test --features full: 329 passed, 10 ignored.cargo clippy --features full -- -D warnings.cargo check --no-default-features --features client,http2.Repository Rust sources pass
rustfmt --check --edition 2021.The description, docs, and comments (words meant for humans) are written by a human, not by an LLM. (https://seanmonstar.com/micro/20260729-i-want-your-own-words/)