fallback to excalidraw.com if no origin header present

This commit is contained in:
dwelle 2021-01-14 12:22:52 +01:00
parent c970c74a2b
commit 1de26f690b

View File

@ -24,7 +24,7 @@ const io = socketIO(server, {
handlePreflightRequest: function (req, res) { handlePreflightRequest: function (req, res) {
var headers = { var headers = {
"Access-Control-Allow-Headers": "Content-Type, Authorization", "Access-Control-Allow-Headers": "Content-Type, Authorization",
"Access-Control-Allow-Origin": req.header ? req.header.origin : "https://excalidraw.com", "Access-Control-Allow-Origin": (req.header && req.header.origin) || "https://excalidraw.com",
"Access-Control-Allow-Credentials": true, "Access-Control-Allow-Credentials": true,
}; };
res.writeHead(200, headers); res.writeHead(200, headers);