Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: Move allowedOrigins to top level

Richie McIlroy31d1a5215e1c
diff --git a/apps/web/app/api/desktop/video/create/route.ts b/apps/web/app/api/desktop/video/create/route.ts
index 8bc9728c0..bdd285dbe 100644
--- a/apps/web/app/api/desktop/video/create/route.ts
+++ b/apps/web/app/api/desktop/video/create/route.ts
@@ -4,19 +4,19 @@ import { videos } from "@cap/database/schema";
import { getCurrentUser } from "@cap/database/auth/session";
import { nanoId } from "@cap/database/helpers";
+const allowedOrigins = [
+ process.env.NEXT_PUBLIC_URL,
+ "http://localhost:3001",
+ "tauri://localhost",
+ "http://tauri.localhost",
+ "https://tauri.localhost",
+];
+
export async function OPTIONS(req: NextRequest) {
const params = req.nextUrl.searchParams;
const origin = params.get("origin") || null;
const originalOrigin = req.nextUrl.origin;
- const allowedOrigins = [
- process.env.NEXT_PUBLIC_URL,
- "http://localhost:3001",
- "tauri://localhost",
- "http://tauri.localhost",
- "https://tauri.localhost",
- ];
-
return new Response(null, {
status: 200,
headers: {