import type { NextConfig } from "next"; const contentSecurityPolicy = [ "default-src 'self'", "base-uri 'self'", "form-action 'self'", "frame-ancestors 'none'", "object-src 'none'", "img-src 'self' data: blob:", "font-src 'self' data:", "style-src 'self' 'unsafe-inline'", `script-src 'self' 'unsafe-inline'${process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""}`, "connect-src 'self'", ].join("; "); const nextConfig: NextConfig = { images: { qualities: [75, 94], }, async headers() { return [{ source: "/:path*", headers: [ { key: "Content-Security-Policy", value: contentSecurityPolicy }, { key: "Permissions-Policy", value: "camera=(), microphone=(), geolocation=(), browsing-topics=()" }, { key: "Referrer-Policy", value: "strict-origin-when-cross-origin" }, { key: "Strict-Transport-Security", value: "max-age=63072000; includeSubDomains; preload" }, { key: "X-Content-Type-Options", value: "nosniff" }, { key: "X-Frame-Options", value: "DENY" }, ], }]; }, }; export default nextConfig;