From f37fc7c74d80975e26a3738d1613947b156cf8fc Mon Sep 17 00:00:00 2001 From: jazicorn <40859840+jazicorn@users.noreply.github.com> Date: Wed, 4 Oct 2023 22:53:43 -0400 Subject: [PATCH] updated header options --- apps/api/src/server.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/api/src/server.ts b/apps/api/src/server.ts index 41a09cc..d16c105 100644 --- a/apps/api/src/server.ts +++ b/apps/api/src/server.ts @@ -28,7 +28,7 @@ class App { })); this.app.use(bodyParser.json()); this.app.use(cookieParser()); - this.app.use(cors({ + this.app.options("*", cors({ origin: this.corsOptions, credentials : true, methods: 'GET,PUT,POST,DELETE,OPTIONS', @@ -43,7 +43,7 @@ class App { // this.app.options("/", (req, res) => { // res.setHeader("Access-Control-Allow-Origin", "*"); // res.setHeader("Access-Control-Allow-Methods", "PUT, POST, GET, DELETE, OPTIONS"); - // res.setHeader("Access-Control-Allow-Headers", "Content-Type"); + // res.setHeader("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept, Authorizatione"); // res.sendStatus(204); // }); // this.app.set('trust proxy', 1) // trust first proxy