summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-09-30 19:12:36 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2020-10-02 13:35:03 +0200
commit5261e5df8538125731acd7ebc49bd295b288eadb (patch)
tree1a8e4d91ce0abac66022a56937f78a6c3229ee35
parent72a3759ae5b56e5483ef82f8cf8831c6174f2087 (diff)
Add COOP/COEP headers to HTML5 "run" server.
This allow the page to be considered a SecureContext if the address is localhost (127.0.0.1/::1) and let Firefox (and future Chrome versions) enable extra features needed for the HTML5 threaded export.
-rw-r--r--platform/javascript/export/export.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/platform/javascript/export/export.cpp b/platform/javascript/export/export.cpp
index 230575abce..a83ff44d20 100644
--- a/platform/javascript/export/export.cpp
+++ b/platform/javascript/export/export.cpp
@@ -124,6 +124,9 @@ public:
String s = "HTTP/1.1 200 OK\r\n";
s += "Connection: Close\r\n";
s += "Content-Type: " + ctype + "\r\n";
+ s += "Access-Control-Allow-Origin: *\r\n";
+ s += "Cross-Origin-Opener-Policy: same-origin\r\n";
+ s += "Cross-Origin-Embedder-Policy: require-corp\r\n";
s += "\r\n";
CharString cs = s.utf8();
Error err = connection->put_data((const uint8_t *)cs.get_data(), cs.size() - 1);