import { NextResponse } from "next/server"; const ALLOWED_ORIGIN = "https://fristy.net"; export function isAllowedOrigin(request: Request): boolean { const origin = request.headers.get("origin"); return origin === null || origin === ALLOWED_ORIGIN; } export function corsHeaders(): HeadersInit { return { "Access-Control-Allow-Origin": ALLOWED_ORIGIN, Vary: "Origin", }; } export function forbidden(): NextResponse { return NextResponse.json({ error: "Forbidden" }, { status: 403 }); }