Skip to content

Commit a7c2f85

Browse files
committed
Add new CORS configuration related to preflight for android
1 parent cac2c7c commit a7c2f85

File tree

2 files changed

+12
-12
lines changed

2 files changed

+12
-12
lines changed

backend/src/iac/backend-stack.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -447,27 +447,27 @@ export class BackendStack extends cdk.Stack {
447447
api.root.addCorsPreflight(corsOptions);
448448
apiResource.addCorsPreflight({
449449
...corsOptions,
450-
allowCredentials: false // This is crucial - make sure OPTIONS requests don't require credentials
450+
allowCredentials: false, // This is crucial - make sure OPTIONS requests don't require credentials
451451
});
452452
reportsResource.addCorsPreflight({
453453
...corsOptions,
454-
allowCredentials: false
454+
allowCredentials: false,
455455
});
456456
latestResource.addCorsPreflight({
457457
...corsOptions,
458-
allowCredentials: false
458+
allowCredentials: false,
459459
});
460460
reportIdResource.addCorsPreflight({
461461
...corsOptions,
462-
allowCredentials: false
462+
allowCredentials: false,
463463
});
464464
reportStatusResource.addCorsPreflight({
465465
...corsOptions,
466-
allowCredentials: false
466+
allowCredentials: false,
467467
});
468468
docsResource.addCorsPreflight({
469469
...corsOptions,
470-
allowCredentials: false
470+
allowCredentials: false,
471471
});
472472

473473
// Configure Gateway Responses to add CORS headers to error responses

backend/src/main.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@ async function bootstrap() {
1313
// Enable CORS
1414
app.enableCors({
1515
origin: [
16-
'http://localhost:5173',
17-
'http://localhost:3000',
18-
'http://localhost:4173',
19-
'https://localhost', // Add this for Capacitor
20-
...(process.env.FRONTEND_URL ? [process.env.FRONTEND_URL] : []),
21-
],
16+
'http://localhost:5173',
17+
'http://localhost:3000',
18+
'http://localhost:4173',
19+
'https://localhost', // Add this for Capacitor
20+
...(process.env.FRONTEND_URL ? [process.env.FRONTEND_URL] : []),
21+
],
2222
methods: 'GET,HEAD,PUT,PATCH,POST,DELETE,OPTIONS',
2323
credentials: true,
2424
});

0 commit comments

Comments
 (0)