Browse Source

Merge pull request #149 from excalidraw/fix_cors

master
David Luzar 4 years ago
parent
commit
dda25d7920
No account linked to committer's email address
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      src/index.ts

+ 2
- 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 : "*",
27
+      "Access-Control-Allow-Origin":
28
+        (req.header && req.header.origin) || "https://excalidraw.com",
28
       "Access-Control-Allow-Credentials": true,
29
       "Access-Control-Allow-Credentials": true,
29
     };
30
     };
30
     res.writeHead(200, headers);
31
     res.writeHead(200, headers);

Loading…
Cancel
Save