xia-chao opened PR #14784 from xia-chao:wasi-http-get-body-framing to bytecodealliance:main:
An outgoing GET, HEAD or CONNECT request dropped its body. The host now adds transfer-encoding: chunked, which hyper requires for those methods.
xia-chao requested rvolosatovs for a review on PR #14784.
xia-chao requested wasmtime-wasi-reviewers for a review on PR #14784.
xia-chao requested wasmtime-core-reviewers for a review on PR #14784.
xia-chao requested pchickey for a review on PR #14784.
:memo: rvolosatovs submitted PR review:
I find it quite surprising for GET/HEAD/CONNECT requests to carry a body, in fact I would expect the (default) wasi-http implementation to explicitly reject such requests.
Could you share a bit more context as to why this would be a desirable feature?
xia-chao commented on PR #14784:
it's not that get bodies are desirable. today the body is accepted, finish returns ok, and the origin receives none,that's the bug. rejecting is fine with us, but it would also fail ge ts that create a body and write nothing.
xia-chao commented on PR #14784:
If the preference is to reject the request, which error code should the
handlefunction return?
And if you’d rather reject it, then you should be the one to handle this task.
xia-chao edited a comment on PR #14784:
If the preference is to reject the request, which error code should the
handlefunction return?
rvolosatovs commented on PR #14784:
If the preference is to reject the request, which error code should the
handlefunction return?
HTTP-protocol-errorperhaps?Otherwise, we could also just use
internal-errorwith a message I think https://github.com/WebAssembly/WASI/blob/463701e0f6c575a5d24ae31c2ec1e0ebf09d28e1/proposals/http/wit/types.wit#L79
xia-chao updated PR #14784.
xia-chao commented on PR #14784:
Tried the “HTTP protocol error” thing, but with that “/get with body” also fails, since the host can’t really tell whether a body has content. Keep sending for now. Also added a case where a GET body gets created but never written to.
xia-chao commented on PR #14784:
So I don't recommend rejecting the request, do you think?
Last updated: Oct 31 2026 at 23:03 UTC