]> git.djapps.eu Git - pkg/ggml/sources/whisper.cpp/commitdiff
server : set default CORS headers to allow all (#1567)
authorKasumi <redacted>
Tue, 28 Nov 2023 09:55:20 +0000 (17:55 +0800)
committerGitHub <redacted>
Tue, 28 Nov 2023 09:55:20 +0000 (11:55 +0200)
examples/server/server.cpp

index dc5317a0e1c6e39f49e9ed9a7800627c6a8a785b..e9d3f88b24692451f71e1c4b7b24fcdb2b6dbed0 100644 (file)
@@ -468,6 +468,9 @@ int main(int argc, char ** argv) {
     whisper_ctx_init_openvino_encoder(ctx, nullptr, params.openvino_encode_device.c_str(), nullptr);
 
     Server svr;
+    svr.set_default_headers({{"Server", "whisper.cpp"},
+                             {"Access-Control-Allow-Origin", "*"},
+                             {"Access-Control-Allow-Headers", "content-type"}});
 
     std::string const default_content = "<html>hello</html>";