From 250e8dfc6e6c2729c8f829ca54f54f0d624674f6 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Wed, 18 Dec 2024 10:08:32 -0700 Subject: [PATCH 1/3] add `response-outparam.send-informational` 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 --- wit/types.wit | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/wit/types.wit b/wit/types.wit index 0bd34fc..9c0ce8b 100644 --- a/wit/types.wit +++ b/wit/types.wit @@ -435,6 +435,21 @@ interface types { /// other argument to `incoming-handler.handle`. @since(version = 0.2.0) resource response-outparam { + /// Send an HTTP 1xx response. + /// + /// 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`. + /// + /// This will return an `HTTP-protocol-error` if `status` is not in the + /// range [100-199], or an `internal-error` if the implementation does not + /// support informational responses. + @unstable(feature = informational-outbound-responses) + send-informational: func( + status: u16, + headers: headers + ) -> result<_, error-code>; /// Set the value of the `response-outparam` to either send a response, /// or indicate an error. From a377bea197bda200b1b745fc6921db770fd92851 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 10 Jan 2025 10:45:20 -0700 Subject: [PATCH 2/3] update wit-bindgen version Signed-off-by: Joel Dice --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index d7a090b..381442d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -19,5 +19,5 @@ jobs: - uses: WebAssembly/wit-abi-up-to-date@v22 with: wasm-tools: '1.218.0' - wit-bindgen: '0.33.0' + wit-bindgen: '0.37.0' worlds: 'imports proxy' From 2c78338fecadea03ebc1e32451d7be7cb12d93b0 Mon Sep 17 00:00:00 2001 From: Joel Dice Date: Fri, 10 Jan 2025 10:49:10 -0700 Subject: [PATCH 3/3] update wasm-tools version Signed-off-by: Joel Dice --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 381442d..a4336b2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,6 +18,6 @@ jobs: ./wit-deps lock --check - uses: WebAssembly/wit-abi-up-to-date@v22 with: - wasm-tools: '1.218.0' + wasm-tools: '1.223.0' wit-bindgen: '0.37.0' worlds: 'imports proxy'