From 89994619408074fe948bcbe2e93a2d729addec3a Mon Sep 17 00:00:00 2001 From: Panayiotis Lipiridis Date: Fri, 5 Feb 2021 01:47:19 +0200 Subject: [PATCH] source --- src/index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 91acf94..a020add 100755 --- a/src/index.ts +++ b/src/index.ts @@ -24,7 +24,8 @@ const io = socketIO(server, { handlePreflightRequest: function (req, res) { const headers = { "Access-Control-Allow-Headers": "Content-Type, Authorization", - "Access-Control-Allow-Origin": "*", + "Access-Control-Allow-Origin": + (req.header && req.header.origin) || "https://excalidraw.com", "Access-Control-Allow-Credentials": true, }; res.writeHead(200, headers);