From 351e5e64c0a9aaf019437d472f9daf7813f6f444 Mon Sep 17 00:00:00 2001 From: sophie Date: Thu, 23 May 2024 17:44:06 +0300 Subject: [PATCH] fix this shi --- server/src/index.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/index.ts b/server/src/index.ts index 0598e50..676b960 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -58,11 +58,11 @@ const app = new Elysia() .use( cors({ origin: (context) => { - return /(http(|s):\/\/|)(sad\.ovh|127\.0\.0\.1|localhost)(:\d{1,4}|)(\/|)/gm.test( + return /^(http(|s):\/\/|)(api\.chat\.sad\.ovh|sad\.ovh|127\.0\.0\.1|localhost)(:\d{1,4}|)(\/|)$/gm.test( context.url ); // TODO fix this }, - allowedHeaders: "Origin, X-Requested-With, Content-Type, Accept", + allowedHeaders: "Origin, X-Requested-With, Content-Type, Accept, Cookie", }) ) .use(