* Middleware only logic to add CSP header as Next.js App Router doesnt allow setting header in server component * add tests * Remove nonce from Page Router and fix ts issues * Add checkly test
17 lines
434 B
TypeScript
17 lines
434 B
TypeScript
import { headers } from "next/headers";
|
|
|
|
import PageWrapper from "@components/PageWrapperAppDir";
|
|
|
|
export default async function BookingPageWrapperLayout({ children }: { children: React.ReactNode }) {
|
|
const h = await headers();
|
|
const nonce = h.get("x-csp-nonce") ?? undefined;
|
|
|
|
return (
|
|
<>
|
|
<PageWrapper isBookingPage={true} requiresLicense={false} nonce={nonce}>
|
|
{children}
|
|
</PageWrapper>
|
|
</>
|
|
);
|
|
}
|