Skip to content

Commit b57d3b3

Browse files
authored
Support adding header to wasm http request containing runtime token (#153)
1 parent 17279da commit b57d3b3

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/wasm/stream.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,10 @@ EM_JS(
7272
// Should this only be set if using https? What about CORS via http?
7373
xhr.setRequestHeader("Authorization", authorization_header_js);
7474
}
75+
if (!"{#{RUNTIME_TOKEN}#}".startsWith("{#{"))
76+
{
77+
xhr.setRequestHeader("x-runtime-token", "{#{RUNTIME_TOKEN}#}");
78+
}
7579

7680
// Cache request info on JavaScript side so that it is available in subsequent calls
7781
// without having to pass it back and forth to/from C++.

0 commit comments

Comments
 (0)