headers route

This commit is contained in:
Max Peintner
2025-02-07 08:56:01 +01:00
parent 91a05bb143
commit 144068e3e7

View File

@@ -0,0 +1,13 @@
import { NextRequest, NextResponse } from "next/server";
export const dynamic = "force-dynamic";
export const revalidate = false;
export const fetchCache = "default-no-store";
export async function GET(request: NextRequest) {
const headers = request.headers;
// Convert headers to a plain object
const headersObject: Record<string, string> = {};
headers.forEach((value, key) => {
headersObject[key] = value;
});
return NextResponse.json(headersObject);
}