From 0e54d0a3383a05922b27ce93e8e2bae5cdc2231a Mon Sep 17 00:00:00 2001 From: fakuzatsu Date: Wed, 4 Nov 2026 21:22:54 +0000 Subject: [PATCH] adds headers to nextjs to prevent abuse --- next.config.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/next.config.ts b/next.config.ts index eeeaf81..11b4fa9 100644 --- a/next.config.ts +++ b/next.config.ts @@ -18,6 +18,12 @@ const nextConfig: NextConfig = { ], }, headers: async () => { + const securityHeaders = [ + { key: "Content-Security-Policy", value: "frame-ancestors 'none'" }, + { key: "X-Frame-Options", value: "DENY" }, + { key: "X-Content-Type-Options", value: "nosniff" }, + { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, + ]; const longBrowserCache = [ { key: "Cache-Control", @@ -25,6 +31,7 @@ const nextConfig: NextConfig = { }, ]; return [ + { source: "/:path*", headers: securityHeaders }, { source: "/logo.png", headers: longBrowserCache }, { source: "/favicon.ico", headers: longBrowserCache }, ];