Skip to content

add response-outparam.send-informational #139

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 10, 2025

Conversation

dicej
Copy link
Collaborator

@dicej dicej commented Dec 18, 2024

This allows a server to send zero or more HTTP 1xx responses prior to sending the final response using response-outparam.set.

Note that this does not include support for consuming informational responses for outbound requests (which would be required to losslessly proxy such requests).

@dicej
Copy link
Collaborator Author

dicej commented Dec 18, 2024

I believe the CI failure is due to a bug in how wit-parser handles WIT features. Working on a fix for that now.

@dicej
Copy link
Collaborator Author

dicej commented Dec 18, 2024

The CI failure should be addressed by bytecodealliance/wasm-tools#1958 once that fix makes its way to a wit-bindgen release and we adopt it in this repo's workflow.

Copy link
Member

@lukewagner lukewagner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In a 0.3 interface response-outparam goes away and we have to worry more about composability, but for a 0.2 interface, we don't have practical component-to-component composition, so this makes sense.

dicej added 2 commits January 10, 2025 10:41
This allows a server to send zero or more HTTP 1xx responses prior to sending
the final response using `response-outparam.set`.

Note that this does not include support for consuming informational responses
for outbound requests (which would be required to losslessly proxy such
requests).

Signed-off-by: Joel Dice <[email protected]>
@dicej dicej force-pushed the send-informational branch from 7687721 to a377bea Compare January 10, 2025 17:46
Signed-off-by: Joel Dice <[email protected]>
@dicej dicej merged commit 8eb7f8a into WebAssembly:main Jan 10, 2025
1 check passed
@dicej dicej deleted the send-informational branch January 10, 2025 17:49
badeend added a commit to badeend/wasmtime that referenced this pull request Jun 16, 2025
This includes two changes:

# WebAssembly/wasi-filesystem#165
Documentation update

# WebAssembly/wasi-http#139
Adds a new unstable `send-informational` function to the `response-outparam` resource. I've left this `unimplemented!()`.
/// Unlike `response-outparam.set`, this does not consume the
/// `response-outparam`, allowing the guest to send an arbitrary number of
/// informational responses before sending the final response using
/// `response-outparam.set`.
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe a bit late, but does this also allow sending 101 Switching Protocols which indicates that the following data will be for a non-http protocol?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't tried it myself, but I think that should work even without response-outparam.send-informational. IIUC, a 101 only requires sending a single HTTP-level response (unlike 103, which involves sending more than one), so presumably you could use response-outparam.set to send a 101, then treat the request input-stream and response output-stream as a full-duplex connection over which the agreed-upon protocol may proceed.

Whether that works today with e.g. wasmtime-wasi-http is another question -- probably not, but I don't see any obstacle at the WIT interface level to making it work.

github-merge-queue bot pushed a commit to bytecodealliance/wasmtime that referenced this pull request Jun 16, 2025
This includes two changes:

# WebAssembly/wasi-filesystem#165
Documentation update

# WebAssembly/wasi-http#139
Adds a new unstable `send-informational` function to the `response-outparam` resource. I've left this `unimplemented!()`.
github-merge-queue bot pushed a commit to bytecodealliance/wasmtime that referenced this pull request Jun 16, 2025
* Update to WASI 0.2.6.

This includes two changes:

# WebAssembly/wasi-filesystem#165
Documentation update

# WebAssembly/wasi-http#139
Adds a new unstable `send-informational` function to the `response-outparam` resource. I've left this `unimplemented!()`.

* Trap instead of panic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants