From cd7e2e7a0fd3316d227f90039be4d724e3ad9bf9 Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Wed, 21 Feb 2024 21:59:12 +0100 Subject: [PATCH] server.js aktualisiert --- server.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server.js b/server.js index aa5fa50..0cfe712 100644 --- a/server.js +++ b/server.js @@ -101,11 +101,11 @@ app.use(fileUpload({ })); const corsOptions = { origin: (origin, callback) => { - if (!origin || config.allowed_domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) { + if (!origin || config.domain == origin.replace(/:\d*$/g, "") || config.allowed_domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) { callback(null, true); } else { database.system.domains((domains) => { - if (config.domain == origin.replace(/:\d*$/g, "") || domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) { + if (domains.indexOf(origin.replace(/:\d*$/g, "")) !== -1) { callback(null, true); } else { callback("Origin not allowed: " + origin);