diff --git a/vault/next.config.ts b/vault/next.config.ts new file mode 100644 index 0000000..f40667b --- /dev/null +++ b/vault/next.config.ts @@ -0,0 +1,41 @@ +import type { NextConfig } from "next"; + +const nextConfig: NextConfig = { + async headers() { + const contentSecurityPolicy = [ + "default-src 'self'", + "script-src 'self' 'unsafe-eval' 'unsafe-inline'", + "style-src 'self' 'unsafe-inline'", + "img-src 'self' data: blob:", + "font-src 'self'", + "connect-src 'self'", + "media-src 'self'", + "object-src 'none'", + "base-uri 'self'", + "form-action 'self'", + "frame-ancestors 'none'", + ].join("; "); + + return [ + { + source: "/:path*", + headers: [ + { + key: "Content-Security-Policy", + value: contentSecurityPolicy, + }, + { + key: "Referrer-Policy", + value: "strict-origin-when-cross-origin", + }, + { + key: "X-Content-Type-Options", + value: "nosniff", + }, + ], + }, + ]; + }, +}; + +export default nextConfig;