瀏覽代碼

fix: ensure non-* CORS origin header is set if no req headers sent

master
dwelle 4 年之前
父節點
當前提交
c970c74a2b
共有 1 個檔案被更改,包括 1 行新增1 行删除
  1. 1
    1
      src/index.ts

+ 1
- 1
src/index.ts 查看文件

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": 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…
取消
儲存