Skip to content

Commit

Permalink
Fix CORS headers on app-staging (#1978)
Browse files Browse the repository at this point in the history
  • Loading branch information
dubwub authored Jan 9, 2025
1 parent c03ce4d commit 56b9fff
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
8 changes: 0 additions & 8 deletions packages/fern-docs/bundle/next.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,6 @@ const nextConfig = {
source: "/api/fern-docs/auth/:path*",
headers: AccessControlHeaders,
},
{
source: "/api/fern-docs/search/v2/:path*",
headers: AccessControlHeaders,
},
{
source: "/:prefix*/api/fern-docs/search/v2/:path*",
headers: AccessControlHeaders,
},
{
source: "/:prefix*/api/fern-docs/auth/:path*",
headers: AccessControlHeaders,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const revalidate = 0;
export async function OPTIONS(_: NextRequest) {
const response = new NextResponse();
response.headers.set("Access-Control-Allow-Origin", "*");
response.headers.set("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
response.headers.set("Access-Control-Allow-Methods", "POST, OPTIONS");
response.headers.set("Access-Control-Allow-Headers", "Content-Type");
return response;
}
Expand Down Expand Up @@ -149,7 +149,7 @@ export async function POST(req: NextRequest) {

const response = result.toDataStreamResponse();
response.headers.set("Access-Control-Allow-Origin", "*");
response.headers.set("Access-Control-Allow-Methods", "GET, POST, OPTIONS");
response.headers.set("Access-Control-Allow-Methods", "POST, OPTIONS");
response.headers.set("Access-Control-Allow-Headers", "Content-Type");
return response;
}
Expand Down

0 comments on commit 56b9fff

Please sign in to comment.