From f542baf05f1e39c09a034ae048f807d8292d05b7 Mon Sep 17 00:00:00 2001 From: Linwei Shang Date: Tue, 16 Jun 2026 15:26:06 -0400 Subject: [PATCH] docs: fix HTTP gateway streaming callback return type The streaming callback must return a non-opt StreamingCallbackHttpResponse, matching the real HTTP gateway (ic_boundary) implementation. The spec incorrectly wrapped the return type in opt. Confirmed by the StreamingCallbackFunction definition in dfinity/internet-identity and every shipping .did interface. Detected while adding e2e tests for streaming certified-assets (dfinity/certified-assets#96). --- docs/references/http-gateway-protocol-spec.md | 4 ++-- public/references/http-gateway.did | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/references/http-gateway-protocol-spec.md b/docs/references/http-gateway-protocol-spec.md index 5e2043d2..63d79edb 100644 --- a/docs/references/http-gateway-protocol-spec.md +++ b/docs/references/http-gateway-protocol-spec.md @@ -423,7 +423,7 @@ type StreamingCallbackHttpResponse = record { type StreamingStrategy = variant { Callback: record { - callback: func (StreamingToken) -> (opt StreamingCallbackHttpResponse) query; + callback: func (StreamingToken) -> (StreamingCallbackHttpResponse) query; token: StreamingToken; }; }; @@ -509,7 +509,7 @@ type StreamingCallbackHttpResponse = record { type StreamingStrategy = variant { Callback: record { - callback: func (StreamingToken) -> (opt StreamingCallbackHttpResponse) query; + callback: func (StreamingToken) -> (StreamingCallbackHttpResponse) query; token: StreamingToken; }; }; diff --git a/public/references/http-gateway.did b/public/references/http-gateway.did index 3ec2d9c6..9e2e305a 100644 --- a/public/references/http-gateway.did +++ b/public/references/http-gateway.did @@ -38,7 +38,7 @@ type StreamingCallbackHttpResponse = record { type StreamingStrategy = variant { Callback: record { - callback: func (StreamingToken) -> (opt StreamingCallbackHttpResponse) query; + callback: func (StreamingToken) -> (StreamingCallbackHttpResponse) query; token: StreamingToken; }; };