From a60e261d78a160056c920f99da96995d52b931bb Mon Sep 17 00:00:00 2001 From: Cogent Apps Date: Fri, 17 Mar 2023 19:05:14 +0000 Subject: [PATCH] remove CORS --- server/src/index.ts | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/server/src/index.ts b/server/src/index.ts index df4ff94..efd2958 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -65,17 +65,6 @@ export default class ChatServer { this.app.use(express.json({ limit: '1mb' })); this.app.use(compression()); - this.app.use((req, res, next) => { - res.set({ - 'Access-Control-Allow-Origin': origins.includes(req.headers.origin!) ? req.headers.origin : origins[0], - 'Access-Control-Allow-Credentials': true.toString(), - 'Access-Control-Allow-Methods': 'GET,POST,PUT,OPTIONS', - 'Access-Control-Max-Age': 2592000, - 'Access-Control-Allow-Headers': 'Content-Type, Authorization', - }); - next(); - }); - const { default: rateLimit } = await import('express-rate-limit'); // esm const limiter = rateLimit({ windowMs: 15 * 60 * 1000, // 15 minutes