From d507f1f0c8421236264a32ad625d9f43f630d12a Mon Sep 17 00:00:00 2001 From: Jason Crawford Date: Tue, 24 Feb 2026 07:22:42 -0800 Subject: [PATCH 1/2] fix: handle OPTIONS requests on /api/checks/run Add an OPTIONS handler returning 204 No Content to prevent 400 errors when clients send preflight requests. Closes #60 Co-Authored-By: Claude Opus 4.6 --- src/app/api/checks/run/route.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/app/api/checks/run/route.ts b/src/app/api/checks/run/route.ts index d70f136..340b0de 100644 --- a/src/app/api/checks/run/route.ts +++ b/src/app/api/checks/run/route.ts @@ -118,3 +118,7 @@ async function handleCheckRun(request: NextRequest) { } export { handleCheckRun as GET, handleCheckRun as POST } + +export function OPTIONS() { + return new NextResponse(null, { status: 204 }) +} From 6636c0f048ebc7bf14e88babb277c30ee683003f Mon Sep 17 00:00:00 2001 From: Jason Crawford Date: Tue, 24 Feb 2026 19:31:12 -0800 Subject: [PATCH 2/2] fix: handle OPTIONS requests in middleware Return 204 for OPTIONS preflight requests early in the middleware, before Supabase auth processing. This fixes 400 errors on all routes, not just the API endpoint. Closes #60 Co-Authored-By: Claude Opus 4.6 --- src/middleware.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/middleware.ts b/src/middleware.ts index 8fbe42e..6df478c 100644 --- a/src/middleware.ts +++ b/src/middleware.ts @@ -4,6 +4,10 @@ import { NextResponse, type NextRequest } from "next/server" const protectedRoutes = ["/settings"] export async function middleware(request: NextRequest) { + if (request.method === "OPTIONS") { + return new NextResponse(null, { status: 204 }) + } + let supabaseResponse = NextResponse.next({ request, })