瀏覽代碼

fallback to excalidraw.com if no origin header present

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

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

@@ -24,7 +24,7 @@ const io = socketIO(server, {
24 24
   handlePreflightRequest: function (req, res) {
25 25
     var headers = {
26 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 28
       "Access-Control-Allow-Credentials": true,
29 29
     };
30 30
     res.writeHead(200, headers);

Loading…
取消
儲存