feat: comment out CORS configuration in bootstrap function
This commit is contained in:
+17
-17
@@ -83,25 +83,25 @@ async function bootstrap() {
|
||||
}
|
||||
}
|
||||
|
||||
app.enableCors({
|
||||
origin: (origin, callback) => {
|
||||
if (!origin) {
|
||||
callback(null, true)
|
||||
return
|
||||
}
|
||||
// app.enableCors({
|
||||
// origin: (origin, callback) => {
|
||||
// if (!origin) {
|
||||
// callback(null, true)
|
||||
// return
|
||||
// }
|
||||
|
||||
if (isOriginAllowed(origin)) {
|
||||
callback(null, true)
|
||||
return
|
||||
}
|
||||
// if (isOriginAllowed(origin)) {
|
||||
// callback(null, true)
|
||||
// return
|
||||
// }
|
||||
|
||||
callback(new Error('Not allowed by CORS'), false)
|
||||
},
|
||||
credentials: true,
|
||||
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
|
||||
allowedHeaders:
|
||||
'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token, pos_id',
|
||||
})
|
||||
// callback(new Error('Not allowed by CORS'), false)
|
||||
// },
|
||||
// credentials: true,
|
||||
// methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
|
||||
// allowedHeaders:
|
||||
// 'Content-Type, Accept, Authorization, X-Requested-With, X-CSRF-Token, pos_id',
|
||||
// })
|
||||
|
||||
// Register global logging and response mapping interceptors
|
||||
app.useGlobalInterceptors(new LoggingInterceptor(), new ResponseMappingInterceptor())
|
||||
|
||||
Reference in New Issue
Block a user