import { NextResponse, type NextRequest } from "next/server"; /** * The address a page was asked for, for the layouts: the admin's, so signing in comes back to * that exact page (ROADMAP-v3 ยง3, "Sign-in always returns you to where you came from"), and the * root layout's, which shows the preview bar on the site's pages only. */ export function proxy(request: NextRequest) { const headers = new Headers(request.headers); headers.set("x-ccw-path", `${request.nextUrl.pathname}${request.nextUrl.search}`); return NextResponse.next({ request: { headers } }); } // Never Next's own paths (/_next: its files and the development connection). export const config = { matcher: ["/((?!api|_next|favicon.ico).*)"] };