From aad4783415f791ec50ef8fb8989a4312d05a91fe Mon Sep 17 00:00:00 2001 From: nymkappa <1612910616@pm.me> Date: Tue, 4 Feb 2025 21:33:21 +0100 Subject: [PATCH] fix cors --- backend/src/index.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/backend/src/index.ts b/backend/src/index.ts index dc6a8ae1a..3cc73afb7 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -131,6 +131,9 @@ class Server { this.app .use((req: Request, res: Response, next: NextFunction) => { res.setHeader('Access-Control-Allow-Origin', '*'); + res.setHeader('Access-Control-Allow-Methods', 'GET, POST, PUT, DELETE, OPTIONS'); + res.setHeader('Access-Control-Allow-Headers', 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Requested-With'); + res.setHeader('Access-Control-Expose-Headers', 'X-Total-Count,X-Mempool-Auth'); next(); }) .use(express.urlencoded({ extended: true }))