Skip to content

fix(http1): preserve streaming bodies when coercing HTTP/2 requests - #4236

Open
shuvroroy wants to merge 1 commit into
hyperium:masterfrom
shuvroroy:fix/http1-http2-streaming-body
Open

shuvroroy wants to merge 1 commit into
hyperium:masterfrom
shuvroroy:fix/http1-http2-streaming-body

Conversation

@shuvroroy

@shuvroroy shuvroroy commented Oct 18, 2026 •

Copy link
Copy Markdown

An HTTP/2 request sent through an HTTP/1 connection is serialized as HTTP/1.1, but framing only allows chunking for requests originally marked HTTP/1.1. A POST with an unknown-length body and no Content-Length therefore uses a zero-length encoder and silently loses its body.

Allow chunked framing for coerced HTTP/2 requests. The regression sends a two-frame streaming POST through an HTTP/1 client and verifies the received version, chunked framing, complete payload, and body termination.

Validation:

The regression fails before the fix (empty body instead of hello world) and passes afterward.

Existing empty-body coercion test passes.

cargo test --features full: 329 passed, 10 ignored.

cargo clippy --features full -- -D warnings: passed.

Repository-wide rustfmt --check --edition 2021: passed.

cargo check --no-default-features --features client,http1: passed.

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/)

Allow chunked framing for HTTP/2 requests serialized as HTTP/1.1.
Previously, unknown-length bodies without Content-Length used a
zero-length encoder and were silently discarded.

Add an integration regression that verifies the HTTP/1.1 version,
chunked framing, complete payload, and body termination.
@shuvroroy
shuvroroy marked this pull request as ready for review October 18, 2026 10:10

This branch has not been deployed

No deployments
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.

1 participant