Skip to content

Commit

Permalink
cors
Browse files Browse the repository at this point in the history
  • Loading branch information
Szabolcs Szabolcsi-Toth committed Jun 9, 2024
1 parent 2ebcfec commit da2f404
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/middleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ export function middleware(request) {
// retrieve the current response
const res = NextResponse.next()

console.log('middleware cors', request)
console.log('middleware cors', request.headers.origin)

// add the CORS headers to the response
res.headers.append('Access-Control-Allow-Credentials', "true")
res.headers.append('Access-Control-Allow-Origin', request.origin) // replace this your actual origin
res.headers.append('Access-Control-Allow-Origin', '*') // replace this your actual origin
res.headers.append('Access-Control-Allow-Methods', 'GET,DELETE,PATCH,POST,PUT')
res.headers.append(
'Access-Control-Allow-Headers',
Expand Down

0 comments on commit da2f404

Please sign in to comment.