mirror of
https://github.com/prowler-cloud/prowler.git
synced 2026-04-12 12:48:47 +00:00
Co-authored-by: Alan Buscaglia <alanbuscaglia@MacBook-Pro.local> Co-authored-by: alejandrobailo <alejandrobailo94@gmail.com> Co-authored-by: César Arroba <cesar@prowler.com> Co-authored-by: Alejandro Bailo <59607668+alejandrobailo@users.noreply.github.com>
52 lines
1.5 KiB
JavaScript
52 lines
1.5 KiB
JavaScript
/** @type {import('next').NextConfig} */
|
|
|
|
// HTTP Security Headers
|
|
// 'unsafe-eval' is configured under `script-src` because it is required by NextJS for development mode
|
|
const cspHeader = `
|
|
default-src 'self';
|
|
script-src 'self' 'unsafe-inline' 'unsafe-eval' https://js.stripe.com https://www.googletagmanager.com;
|
|
connect-src 'self' https://api.iconify.design https://api.simplesvg.com https://api.unisvg.com https://js.stripe.com https://www.googletagmanager.com;
|
|
img-src 'self' https://www.google-analytics.com https://www.googletagmanager.com;
|
|
font-src 'self';
|
|
style-src 'self' 'unsafe-inline';
|
|
frame-src 'self' https://js.stripe.com https://www.googletagmanager.com;
|
|
frame-ancestors 'none';
|
|
`;
|
|
|
|
module.exports = {
|
|
poweredByHeader: false,
|
|
// Use standalone only in production deployments, not for CI/testing
|
|
...(process.env.NODE_ENV === "production" &&
|
|
!process.env.CI && {
|
|
output: "standalone",
|
|
outputFileTracingRoot: __dirname,
|
|
}),
|
|
experimental: {
|
|
reactCompiler: true,
|
|
},
|
|
turbopack: {
|
|
root: __dirname,
|
|
},
|
|
async headers() {
|
|
return [
|
|
{
|
|
source: "/(.*)",
|
|
headers: [
|
|
{
|
|
key: "Content-Security-Policy",
|
|
value: cspHeader.replace(/\n/g, ""),
|
|
},
|
|
{
|
|
key: "X-Content-Type-Options",
|
|
value: "nosniff",
|
|
},
|
|
{
|
|
key: "Referrer-Policy",
|
|
value: "strict-origin-when-cross-origin",
|
|
},
|
|
],
|
|
},
|
|
];
|
|
},
|
|
};
|