Skip to content

Commit

Permalink
Add headers
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Nov 2, 2023
1 parent e7f3a5c commit 419370d
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,19 @@ export const middleware = (request: NextRequest) => {

const requestHeaders = new Headers(request.headers);
requestHeaders.set("x-nonce", nonce);
requestHeaders.set("X-DNS-Prefetch-Control", "on");
requestHeaders.set(
"Strict-Transport-Security",
"max-age=63072000; includeSubDomains; preload",
);
requestHeaders.set("X-Frame-Options", "SAMEORIGIN");
requestHeaders.set(
"Permissions-Policy",
"camera=(), microphone=(), geolocation=(), browsing-topics=()",
);
requestHeaders.set("X-Content-Type-Options", "nosniff");
requestHeaders.set("Referrer-Policy", "origin-when-cross-origin");

requestHeaders.set(
"Content-Security-Policy",
cspHeader.replace(/\s{2,}/g, " ").trim(),
Expand Down

0 comments on commit 419370d

Please sign in to comment.