Skip to content

Commit 2bd0dc5

Browse files
fix: Update CORS to allow specific Netlify domain instead of wildcard
1 parent 2f6dce0 commit 2bd0dc5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

next.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const nextConfig = {
1414
{
1515
source: '/api/:path*',
1616
headers: [
17-
{ key: 'Access-Control-Allow-Origin', value: '*' },
17+
{ key: 'Access-Control-Allow-Origin', value: 'https://alteroffice1.netlify.app' },
1818
{ key: 'Access-Control-Allow-Methods', value: 'GET, POST, PUT, DELETE, OPTIONS' },
1919
{ key: 'Access-Control-Allow-Headers', value: 'Content-Type, Authorization, X-API-Key' },
2020
{ key: 'X-Content-Type-Options', value: 'nosniff' },

src/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export async function middleware(request: NextRequest) {
1212
return new NextResponse(null, {
1313
status: 200,
1414
headers: {
15-
'Access-Control-Allow-Origin': '*',
15+
'Access-Control-Allow-Origin': 'https://alteroffice1.netlify.app',
1616
'Access-Control-Allow-Methods': 'GET, POST, PUT, DELETE, OPTIONS',
1717
'Access-Control-Allow-Headers': 'Content-Type, Authorization, X-API-Key',
1818
'Access-Control-Max-Age': '86400',

0 commit comments

Comments
 (0)