From 3f5ed82672f714425ba8dbfd8667539acb188c22 Mon Sep 17 00:00:00 2001 From: Tindy X <49061470+tindy2013@users.noreply.github.com> Date: Tue, 31 Dec 2024 15:38:56 +0800 Subject: [PATCH] Add CORS header to httplib webserver --- src/server/webserver_httplib.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/server/webserver_httplib.cpp b/src/server/webserver_httplib.cpp index 7bb836f00..627f5109b 100644 --- a/src/server/webserver_httplib.cpp +++ b/src/server/webserver_httplib.cpp @@ -170,6 +170,7 @@ int WebServer::start_web_server_multi(listener_args *args) { res.set_header("Access-Control-Allow-Headers", req.get_header_value("Access-Control-Request-Headers")); } + res.set_header("Access-Control-Allow-Origin", "*"); return httplib::Server::HandlerResponse::Unhandled; }); for (auto &x : redirect_map)