Skip to content

style(http2): use an enum instead of bool in strip_connection_headers() - #4094

Merged
seanmonstar merged 1 commit into
masterfrom
sean/kwumkmtlmvuu
Jun 1, 2026
Merged

style(http2): use an enum instead of bool in strip_connection_headers()#4094
seanmonstar merged 1 commit into
masterfrom
sean/kwumkmtlmvuu

Conversation

@seanmonstar

Copy link
Copy Markdown
Member

Found this is_request: bool parameter which I hate. What does strip_headers(headers, true) mean? Hard to know with just a boolean. Make it an enum.

@seanmonstar
seanmonstar force-pushed the sean/kwumkmtlmvuu branch 3 times, most recently from c1e5d9c to 8ef9889 Compare June 1, 2026 18:08
@seanmonstar
seanmonstar merged commit b80c77d into master Jun 1, 2026
23 checks passed
@seanmonstar
seanmonstar deleted the sean/kwumkmtlmvuu branch June 1, 2026 18:38
arrimorris pushed a commit to arrimorris/hyper that referenced this pull request Aug 19, 2026
`strip_connection_headers` gated the request and response halves of the
`TE` check together under `cfg(feature = "client")`. In a server-only
build the `else` branch disappeared along with the `if`, so responses
never had `TE` removed at all — expanding the crate with
`--no-default-features --features server,http2` leaves the whole check
as `let _ = kind;`. Each half is now gated on its own feature.

This predates HTTP/3 — it arrived with hyperium#4094 and affects the HTTP/2
server the same way; hyper's `--lib` tests do not compile in a
server-only build, so nothing ran the path. Unit tests now cover both
message kinds, each gated so it runs wherever its half is compiled in.

Also documents two things the HTTP/3 modules left implicit: that ALPN
`h3` is the QUIC layer's to configure and hyper can neither see nor set
it, and that `max_late_requests` widens which late streams are accepted
rather than holding an idle connection open — HTTP/2 gets that from its
PING-acknowledged two-stage GOAWAY, and h3 exposes no counterpart.
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