Skip to content

Commit f293f52

Browse files
Fix CORS preflight: allow all headers
1 parent 6e6471c commit f293f52

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/main.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ async function bootstrap() {
2121
return callback(new Error(`CORS blocked for origin: ${origin}`), false);
2222
},
2323
credentials: true,
24-
methods: ['GET', 'POST', 'PUT', 'PATCH', 'DELETE', 'OPTIONS'],
25-
allowedHeaders: ['Content-Type', 'Authorization'],
24+
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
25+
allowedHeaders: '*', // <--- important change
26+
preflightContinue: false,
27+
optionsSuccessStatus: 204,
2628
});
2729

2830
app.useGlobalPipes(

0 commit comments

Comments
 (0)