Skip to content

Open-source status page, incident response and uptime monitoring

chore: add security header (#1102)

Maximilian Kaske4d367368c7ba
diff --git a/apps/web/next.config.js b/apps/web/next.config.js
index 0a479f88d..e5ffaf80f 100644
--- a/apps/web/next.config.js
+++ b/apps/web/next.config.js
@@ -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,
@@ -53,6 +61,9 @@ const nextConfig = {
},
],
},
+ async headers() {
+ return [{ source: "/(.*)", headers: securityHeaders }];
+ },
};
module.exports = withSentryConfig(