Skip to content

Commit

Permalink
fix headers
Browse files Browse the repository at this point in the history
  • Loading branch information
SkidGod4444 committed Nov 11, 2024
1 parent 11fce15 commit 8eed126
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions apps/api/next.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const nextConfig = {
{ key: "Access-Control-Allow-Credentials", value: "true" },
{
key: "Access-Control-Allow-Origin",
value: "https://www.plura.pro, https://app.plura.pro",
value: "https://www.plura.pro",
},
{
key: "Access-Control-Allow-Methods",
Expand All @@ -30,13 +30,12 @@ const nextConfig = {
],
},
{
// Handle OPTIONS requests (pre-flight CORS)
source: "/api/:path*",
headers: [
{ key: "Access-Control-Allow-Credentials", value: "true" },
{
key: "Access-Control-Allow-Origin",
value: "https://www.plura.pro, https://app.plura.pro",
value: "https://app.plura.pro",
},
{
key: "Access-Control-Allow-Methods",
Expand All @@ -47,8 +46,7 @@ const nextConfig = {
value:
"X-CSRF-Token, X-Requested-With, Accept, Accept-Version, Content-Length, Content-MD5, Content-Type, Date, X-Api-Version",
},
// Handle pre-flight request for OPTIONS
{ key: "Access-Control-Max-Age", value: "86400" }, // Cache pre-flight response for 24 hours
{ key: "Access-Control-Expose-Headers", value: "Content-Length" },
],
},
];
Expand Down

0 comments on commit 8eed126

Please sign in to comment.