mirror of
https://github.com/Hackdex-App/hackdex-website.git
synced 2026-12-05 07:47:52 -06:00
adds headers to nextjs to prevent abuse
This commit is contained in:
@@ -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 },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user