Skip to content

Commit

Permalink
fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
proller committed Jan 8, 2024
1 parent 06cfe6e commit 632f680
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/network/wssocket.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,6 @@ void WSSocket::on_http(const websocketpp::connection_hdl &hdl)
if (uri == "/") {
path_serve = http_root + DIR_DELIM + "index.html";
con->append_header("Access-Control-Allow-Origin", "*");
con->append_header("Cross-Origin-Embedder-Policy", "require-corp");
con->append_header("Cross-Origin-Opener-Policy", "same-origin");
} else if (uri == "/favicon.ico") {
path_serve = porting::path_share + DIR_DELIM + "misc" + DIR_DELIM +
PROJECT_NAME + ".ico";
Expand All @@ -110,6 +108,8 @@ void WSSocket::on_http(const websocketpp::connection_hdl &hdl)
}

if (!path_serve.empty()) {
con->append_header("Cross-Origin-Embedder-Policy", "require-corp");
con->append_header("Cross-Origin-Opener-Policy", "same-origin");
con->defer_http_response();
std::ifstream t(path_serve);
std::stringstream buffer;
Expand Down

0 comments on commit 632f680

Please sign in to comment.