fix: ensure non-* CORS origin header is set if no req headers sent
This commit is contained in:
parent
cc4a6ce1b9
commit
c970c74a2b
@ -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 : "*",
|
"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);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user