From bea1fcf11391622b7938e39aebf8ae75971315ef Mon Sep 17 00:00:00 2001 From: Ian Thomas Date: Thu, 7 May 2026 12:15:26 +0100 Subject: [PATCH] Support adding header to wasm http request containing runtime token --- src/wasm/stream.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wasm/stream.cpp b/src/wasm/stream.cpp index 4474834..afc039e 100644 --- a/src/wasm/stream.cpp +++ b/src/wasm/stream.cpp @@ -72,6 +72,10 @@ EM_JS( // Should this only be set if using https? What about CORS via http? xhr.setRequestHeader("Authorization", authorization_header_js); } + if (!"{#{RUNTIME_TOKEN}#}".startsWith("{#{")) + { + xhr.setRequestHeader("x-runtime-token", "{#{RUNTIME_TOKEN}#}"); + } // Cache request info on JavaScript side so that it is available in subsequent calls // without having to pass it back and forth to/from C++.