Browse Source

fallback to excalidraw.com if no origin header present

master
dwelle 4 years ago
parent
commit
1de26f690b
1 changed files with 1 additions and 1 deletions
  1. 1
    1
      src/index.ts

+ 1
- 1
src/index.ts View File

24
   handlePreflightRequest: function (req, res) {
24
   handlePreflightRequest: function (req, res) {
25
     var headers = {
25
     var headers = {
26
       "Access-Control-Allow-Headers": "Content-Type, Authorization",
26
       "Access-Control-Allow-Headers": "Content-Type, Authorization",
27
-      "Access-Control-Allow-Origin": req.header ? req.header.origin : "https://excalidraw.com",
27
+      "Access-Control-Allow-Origin": (req.header && req.header.origin) || "https://excalidraw.com",
28
       "Access-Control-Allow-Credentials": true,
28
       "Access-Control-Allow-Credentials": true,
29
     };
29
     };
30
     res.writeHead(200, headers);
30
     res.writeHead(200, headers);

Loading…
Cancel
Save