test cross origin for websocket domain
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing

Signed-off-by: Christian Richter <crichter@owncloud.com>
This commit is contained in:
Christian Richter
2022-07-19 10:08:58 +02:00
parent a023fbed87
commit 4e13c78c5a

View File

@@ -46,11 +46,20 @@ const webServer = http
if (assets[reqFileName] != undefined && assets[reqFileName] != null) {
extension = reqFileName.split(".").pop();
if (extension == "html" || extension == "html") {
res.writeHead(200, { "Content-Type": "text/html" });
res.writeHead(200, {
"Content-Type": "text/html",
"Access-Control-Allow-Origin": "https://" + config.webSocketDomain,
});
} else if (extension == "js") {
res.writeHead(200, { "Content-Type": "text/javascript" });
res.writeHead(200, {
"Content-Type": "text/javascript",
"Access-Control-Allow-Origin": "https://" + config.webSocketDomain,
});
} else {
res.writeHead(200, { "Content-TYpe": "text/plain" });
res.writeHead(200, {
"Content-TYpe": "text/plain",
"Access-Control-Allow-Origin": "https://" + config.webSocketDomain,
});
}
res.end(assets[reqFileName]);
} else {