headers endpoint

This commit is contained in:
Max Peintner
2025-01-28 13:20:45 +01:00
parent de21556f5d
commit 54a373baec

View File

@@ -0,0 +1,16 @@
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;
const headersObject: Record<string, string> = {};
headers.forEach((value, key) => {
headersObject[key] = value;
});
return NextResponse.json(headersObject);
}