Skip to content

Commit

Permalink
chore: add security header (#1102)
Browse files Browse the repository at this point in the history
  • Loading branch information
mxkaske authored Nov 16, 2024
1 parent 399d791 commit 4d36736
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions apps/web/next.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
const { withContentCollections } = require("@content-collections/next");
const { withSentryConfig } = require("@sentry/nextjs");

// REMINDER: avoid Clickjacking attacks by setting the X-Frame-Options header
const securityHeaders = [
{
key: "X-Frame-Options",
value: "SAMEORIGIN",
},
];

/** @type {import('next').NextConfig} */
const nextConfig = {
reactStrictMode: true,
Expand Down Expand Up @@ -53,6 +61,9 @@ const nextConfig = {
},
],
},
async headers() {
return [{ source: "/(.*)", headers: securityHeaders }];
},
};

module.exports = withSentryConfig(
Expand Down

0 comments on commit 4d36736

Please sign in to comment.