diff --git a/src/middleware.ts b/src/proxy.ts similarity index 59% rename from src/middleware.ts rename to src/proxy.ts index 7fb49d82..35f467db 100644 --- a/src/middleware.ts +++ b/src/proxy.ts @@ -1,10 +1,10 @@ import { type NextRequest, NextResponse } from "next/server"; -// Edge middleware: Prisma can't run here, so we only forward the request path -// (so server components / the access guard can read it via headers()) and -// normalize the real client IP. The DB-backed banned/maintenance checks happen -// in src/lib/access-guard.ts (Node runtime) from the root layout. -export function middleware(req: NextRequest) { +// Edge proxy (formerly "middleware"): Prisma can't run here, so we only forward +// the request path (so server components / the access guard can read it via +// headers()) and normalize the real client IP. The DB-backed banned/maintenance +// checks happen in src/lib/access-guard.ts (Node runtime) from the root layout. +export function proxy(req: NextRequest) { const headers = new Headers(req.headers); headers.set("x-pathname", req.nextUrl.pathname); const ip =