Merge pull request #149 from excalidraw/fix_cors

This commit is contained in:
David Luzar 2021-01-14 14:29:59 +01:00 committed by GitHub
commit dda25d7920
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

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