Skip to content

Commit

Permalink
*update header
Browse files Browse the repository at this point in the history
  • Loading branch information
ethan-crypto committed Sep 1, 2023
1 parent d8b10fd commit 335579b
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions next.config.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
/** @type {import('next').NextConfig} */
const nextConfig = {
async headers() {
return [
return [
{
source: '/',
headers: [
{
// matching all API routes
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{ key: "Access-Control-Allow-Origin", value: "*" },
{ key: "Access-Control-Allow-Methods", value: "GET,OPTIONS,PATCH,DELETE,POST,PUT" },
{ key: "Access-Control-Allow-Headers", value: "X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version" },
]
}
];
key: 'Cross-Origin-Embedder-Policy',
value: 'require-corp',
},
{
key: 'Cross-Origin-Opener-Policy',
value: 'same-origin',
},
],
},
];
},
}
};

module.exports = nextConfig

0 comments on commit 335579b

Please sign in to comment.