Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Add CORS to 500 response

Richie McIlroye7ca31d23692
diff --git a/apps/web/app/api/playlist/route.ts b/apps/web/app/api/playlist/route.ts
index 909354ba9..effd41712 100644
--- a/apps/web/app/api/playlist/route.ts
+++ b/apps/web/app/api/playlist/route.ts
@@ -198,7 +198,13 @@ export async function GET(request: NextRequest) {
{
status: 500,
headers: {
- "Content-Type": "application/json",
+ "Access-Control-Allow-Origin": allowedOrigins.includes(
+ request.nextUrl.origin
+ )
+ ? origin
+ : "null",
+ "Access-Control-Allow-Credentials": "true",
+ "Access-Control-Allow-Methods": "GET, OPTIONS",
},
}
);