elliottt opened PR #7447 from elliottt:trevor/fallible-response-set-status-code
to bytecodealliance:main
:
Validate the
status-code
given tooutoging-reponse
in wasi-http. This forces two changes to the interface:
- The constructor can no longer take a
status-code
argument, as there's no way to indicate errors from a constructor. The solution here is to default thestatus-code
to200
, and useoutgoing-response.set-status-code
to change it when necessary.- The
outgoing-response.set-status-code
method has become fallible, allowing us to indicate to the guest when an invalidstatus-code
has been given.Internally, the change to the wasmtime-wasi-http crate is that we're now storing an
http::StatusCode
instead 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-code
given tooutoging-reponse
in wasi-http. This forces two changes to the interface:
- The constructor can no longer take a
status-code
argument, as there's no way to indicate errors from a constructor. The solution here is to default thestatus-code
to200
, and useoutgoing-response.set-status-code
to change it when necessary.- The
outgoing-response.set-status-code
method has become fallible, allowing us to indicate to the guest when an invalidstatus-code
has been given.Internally, the change to the wasmtime-wasi-http crate is that we're now storing an
http::StatusCode
instead 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: Nov 22 2024 at 17:03 UTC