Some checks failed
Build and Push Docker Images (Trusted) / build-and-push (., docker/caddy/Dockerfile, caddy) (push) Has been cancelled
Build and Push Docker Images (Trusted) / build-and-push (., docker/l4-port-manager/Dockerfile, l4-port-manager) (push) Has been cancelled
Build and Push Docker Images (Trusted) / build-and-push (., docker/web/Dockerfile, web) (push) Has been cancelled
Tests / test (push) Has been cancelled
24 lines
635 B
TypeScript
Executable File
24 lines
635 B
TypeScript
Executable File
import type { ReactNode } from "react";
|
|
import { headers } from "next/headers";
|
|
import "./globals.css";
|
|
import Providers from "./providers";
|
|
|
|
function getNonce(csp: string | null): string | undefined {
|
|
if (!csp) return undefined;
|
|
const m = csp.match(/'nonce-([A-Za-z0-9+/=]+)'/);
|
|
return m?.[1];
|
|
}
|
|
|
|
export default async function RootLayout({ children }: { children: ReactNode }) {
|
|
const h = await headers();
|
|
const nonce = getNonce(h.get("Content-Security-Policy"));
|
|
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<body>
|
|
<Providers nonce={nonce}>{children}</Providers>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|