Skip to content

Commit

Permalink
Check allowed headers for CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahdigh committed Oct 25, 2023
1 parent 6c43d81 commit 7b17bc7
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ async function bootstrap() {
app.use(
cors({
credentials: true,
allowedHeaders: ['Auth'],
allowedHeaders: ['content-type', 'auth'],
// allowedHeaders: ['Auth'],
origin: [
'https://localhost:3001',
'https://staging.pairwise.generalmagic.io',
Expand All @@ -35,17 +36,18 @@ async function bootstrap() {
'http://pairwise.vote',
'http://pairwise.vote/',
'http://www.pairwise.vote/',
'https://pairwise-frontend-git-test-numerous-planets-general-magic.vercel.app',
],
}),
);

app.use(function (req: any, res: any, next: any) {
res.setHeader(
'Access-Control-Allow-Headers',
'X-Requested-With,content-type,auth',
);
next();
});
// app.use(function (req: any, res: any, next: any) {
// res.setHeader(
// 'Access-Control-Allow-Headers',
// 'X-Requested-With,content-type,auth',
// );
// next();
// });

// app.use(function (req: any, res: any, next: any) {
// res.setHeader('Access-Control-Allow-Origin', '*');
Expand Down

0 comments on commit 7b17bc7

Please sign in to comment.