dicej opened PR #14446 from dicej:empty-path-with-query-v2 to bytecodealliance:main:
The behavior of
http::uri::PathAndQuery::from_str("")changed in v1.4.1 of thehttpcrate, and although Wasmtime itself has not yet upgraded from the older version it currently depends on, embedders may end up with a newer version.Specifically, the old behavior was to implicitly convert the empty string to a slash, whereas the new behavior is to return an error.
According to https://datatracker.ietf.org/doc/html/rfc3986#section-3.3, an empty string should be acceptable, and
http::uri::Builder::path_and_querystill allows them, so we use that instead. That ensures consistent behavior regardless of which version of thehttpcrate the embedder ends up depending on.<!--
Please make sure you include the following information:
If this work has been discussed elsewhere, please include a link to that
conversation. If it was discussed in an issue, just mention "issue #...".Explain why this change is needed. If the details are in an issue already,
this can be brief.Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.htmlPlease review the Bytecode Alliance's AI tool usage policy at
https://github.com/bytecodealliance/governance/blob/main/AI_TOOL_POLICY.mdPlease ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
dicej requested pchickey for a review on PR #14446.
dicej requested wasmtime-wasi-reviewers for a review on PR #14446.
alexcrichton commented on PR #14446:
Would you be up for tracking down where/when this changed in the
httpcrate as well? AFAIK that's also intending to be pretty standards-compliant, so I'd be curious to at least be aware of the rationale there
karthik2804 commented on PR #14446:
Here is a discussion I found - https://github.com/hyperium/http/issues/839
Per the doc comment, the change happened in https://github.com/hyperium/http/pull/826, with a follow-up in https://github.com/hyperium/http/pull/853
:thumbs_up: alexcrichton submitted PR review.
dicej updated PR #14446.
dicej added PR #14446 [wasmtime-wasi-http] always accept empty path-with-query to the merge queue.
:check: dicej merged PR #14446.
dicej removed PR #14446 [wasmtime-wasi-http] always accept empty path-with-query from the merge queue.
Last updated: Oct 11 2026 at 04:10 UTC