From 216a339308b05ab25df70f62e6f12c1295c457ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fatih=20Burak=20=C4=B0lk?= Date: Thu, 7 Nov 2024 14:08:09 +0300 Subject: [PATCH] feat: change cors policy --- src/server.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.js b/src/server.js index 5e1df2b..5b0f49e 100644 --- a/src/server.js +++ b/src/server.js @@ -105,7 +105,7 @@ const handleUrls = async (req, res, next) => { }; const cors = async (req, res, next) => { - res.setHeader('Access-Control-Allow-Origin', '*'); + res.setHeader('Access-Control-Allow-Origin', req.header('Origin')); res.setHeader('Access-Control-Allow-Methods', 'GET, PUT, POST, DELETE, HEAD, OPTIONS'); if (req.method === 'OPTIONS') {