xia-chao edited PR #14988.
xia-chao commented on PR #14988:
one helper is fine. but p2 still looks up authority in p2/types.rs, and that's the 500 on a non-ASCII Host --
let _ = authorityisn't dedup. also the serve tests send no Host, and rfc 9112 3.2 makes that a client must, so i fixed the client, not the server.
:memo: xia-chao submitted PR review.
:speech_balloon: xia-chao created PR review comment:
can't be just
let _ = authority;-- for the 400s the helper returnsErrand it has to go throughtxor serve sends 500.
xia-chao deleted a comment on PR #14988:
one helper is fine. but p2 still looks up authority in p2/types.rs, and that's the 500 on a non-ASCII Host --
let _ = authorityisn't dedup. also the serve tests send no Host, and rfc 9112 3.2 makes that a client must, so i fixed the client, not the server.
:memo: pchickey submitted PR review:
Thanks, this restructure helps a lot, I have just a couple more notes for how we should test this to make it super clear we covered all the bases
:speech_balloon: pchickey created PR review comment:
Feels off to require a byte slice argument but return a String, it could return a Vec<u8> and the comparisons can still be
.starts_with(b"HTTP ...").
:speech_balloon: pchickey created PR review comment:
I don't see any reason to check for the HTML contents in these these tests, the starts with status line is sufficient
:speech_balloon: pchickey created PR review comment:
This could be folded down to
if let Err(e) = get_request_target(...) { let _ = tx.send(Err(e)); wasmtime::bail!(...) }
:speech_balloon: pchickey created PR review comment:
Lets restructure these tests: we want to test that, for a given set of requests that check one positive case and various negative cases for the the host headers, both the p2 and p3 implementations of wasmtime-wasi-http handle it properly. So, lets make a single function
async fn test_rfc_9112_sec_3_2(&WasmtimeServe) -> Result<()>that sends all the requests and asserts the responses are what we want, and then invoke it in just two#[tokio::test] async fn pN_cli_serve_rfc_9112_sec_3_2() -> Result<()> { ... }, one of which uses P2_CLI_SERVE_HELLO_WORLD_COMPONENT and the other uses the P3_ one.
xia-chao updated PR #14988.
xia-chao commented on PR #14988:
Done.Thanks!
xia-chao edited a comment on PR #14988:
Done. Thanks!
#14983 and #14993 have been folded into this PR.
xia-chao updated PR #14988.
xia-chao deleted a comment on PR #14988:
Done. Thanks!
#14983 and #14993 have been folded into this PR.
xia-chao commented on PR #14988:
Done. Thanks!
#14983 and #14993 have been folded into this PR, which already covers #15023.
xia-chao updated PR #14988.
xia-chao commented on PR #14988:
Rebased onto the merged #14908: HTTP/2 requests carry the authority in
:authorityand often omitHost, so a missingHostis now only an error for HTTP/1.1. Added h2 coverage for missing, duplicate, invalid, and disagreeingHostvalues.
xia-chao updated PR #14988.
xia-chao updated PR #14988.
:thumbs_up: pchickey submitted PR review:
Thanks for seeing this through
pchickey added PR #14988 wasi-http: validate the Host header in one place to the merge queue.
:check: pchickey merged PR #14988.
pchickey removed PR #14988 wasi-http: validate the Host header in one place from the merge queue.
Last updated: Oct 31 2026 at 23:03 UTC