namse opened PR #13138 from namse:p2-host-header-h1-only to bytecodealliance:main:
Currently,
outgoing_handler::handleunconditionally appends aHostheader to the hyper::Request before callingWasiHttpView::send_request. This is fine for HTTP/1.1, but embedders that overridesend_requestto dispatch over HTTP/2 (e.g. viahyper_util::client::legacy::Clientnegotiating h2 through ALPN) end up sending both:authorityand ahostheader on the wire. Per RFC 9113 §8.3.1, clients generating HTTP/2 requests directly should use:authorityinstead ofHost, and strict servers such as Google's GFE reject the stream with RST_STREAM PROTOCOL_ERROR when both appear.This PR moves the
Hostinsertion out ofhandleand intodefault_send_request_handler, which is the only code path in this crate that terminates inhyper::client::conn::http1::handshake. HTTP/1 dispatch preserves the existing behavior, while customsend_requestimplementations no longer have to strip the header themselves.
namse requested wasmtime-wasi-reviewers for a review on PR #13138.
pchickey submitted PR review.
pchickey added PR #13138 wasmtime-wasi-http: Only inject Host header in the default HTTP/1 send_request path to the merge queue.
pchickey merged PR #13138.
pchickey removed PR #13138 wasmtime-wasi-http: Only inject Host header in the default HTTP/1 send_request path from the merge queue.
Last updated: May 03 2026 at 22:13 UTC