elliottt opened PR #7447 from elliottt:trevor/fallible-response-set-status-code to bytecodealliance:main:
Validate the
status-codegiven tooutoging-reponsein wasi-http. This forces two changes to the interface:
- The constructor can no longer take a
status-codeargument, as there's no way to indicate errors from a constructor. The solution here is to default thestatus-codeto200, and useoutgoing-response.set-status-codeto change it when necessary.- The
outgoing-response.set-status-codemethod has become fallible, allowing us to indicate to the guest when an invalidstatus-codehas been given.Internally, the change to the wasmtime-wasi-http crate is that we're now storing an
http::StatusCodeinstead of a rawu16.
<!--
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 ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
elliottt requested fitzgen for a review on PR #7447.
elliottt requested wasmtime-core-reviewers for a review on PR #7447.
elliottt edited PR #7447:
Validate the
status-codegiven tooutoging-reponsein wasi-http. This forces two changes to the interface:
- The constructor can no longer take a
status-codeargument, as there's no way to indicate errors from a constructor. The solution here is to default thestatus-codeto200, and useoutgoing-response.set-status-codeto change it when necessary.- The
outgoing-response.set-status-codemethod has become fallible, allowing us to indicate to the guest when an invalidstatus-codehas been given.Internally, the change to the wasmtime-wasi-http crate is that we're now storing an
http::StatusCodeinstead of a rawu16.cc @JakeChampion
<!--
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 ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->
elliottt requested pchickey for a review on PR #7447.
JakeChampion submitted PR review.
pchickey submitted PR review.
elliottt has enabled auto merge for PR #7447.
elliottt merged PR #7447.
Last updated: Dec 13 2025 at 19:03 UTC