Skip to content

Commit

Permalink
Add CORS config
Browse files Browse the repository at this point in the history
  • Loading branch information
neoxelox committed Dec 13, 2024
1 parent b372d67 commit 5d74bcb
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions apps/infra/src/core/s3.ts
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,29 @@ new aws.s3.BucketPolicy(
},
{ provider: regionProvider },
)

new aws.s3.BucketCorsConfigurationV2(
'publicLatitudeBucketCors',
{
bucket: publicBucket.id,
corsRules: [
{
allowedHeaders: ['*'],
allowedMethods: ['GET', 'HEAD'],
allowedOrigins: ['https://latitude.so', 'https://*.latitude.so'],
exposeHeaders: [
'ETag',
'Content-Type',
'Content-Length',
'Content-Range',
'Content-Disposition',
'Cache-Control',
'Last-Modified',
'Expires',
],
maxAgeSeconds: 24 * 3600, // 24 hours
},
],
},
{ provider: regionProvider },
)

0 comments on commit 5d74bcb

Please sign in to comment.