Skip to content

Commit

Permalink
chore: remove strict origin checks
Browse files Browse the repository at this point in the history
  • Loading branch information
okjodom committed Nov 27, 2024
1 parent e7758d7 commit a418855
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions apps/api/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,8 @@ function setupCORS(app: INestApplication) {

app.enableCors({
origin: (origin, callback) => {
if (!origin) {
callback(new Error('CORS error null origin'), origin);
}
if (allowedOrigins.indexOf(origin) !== -1) {
callback(new Error('Blocked by CORS'), origin);
} else {
callback(null, origin);
}
// TODO: Strict CORS origin check in production
callback(null, origin);
},
methods: 'GET,POST,PUT,PATCH,DELETE,OPTIONS',
credentials: true,
Expand Down

0 comments on commit a418855

Please sign in to comment.