Skip to content

Commit 0840dce

Browse files
authored
Merge pull request #1972 from visualize-admin/fix/csp-adjustments
fix: Updated CSP headers
2 parents ca194bf + a6f2bb1 commit 0840dce

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

app/next.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,18 @@ module.exports = withPreconstruct(
5555
headers[0].headers.push({
5656
key: "Content-Security-Policy",
5757
value: [
58-
`default-src 'self' 'unsafe-inline'${process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""} https://*.sentry.io https://vercel.live/ https://vercel.com https://*.googletagmanager.com`,
59-
`script-src 'self' 'unsafe-inline'${process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""} https://*.sentry.io https://vercel.live/ https://vercel.com https://*.googletagmanager.com`,
58+
`default-src 'self' 'unsafe-inline'${
59+
process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""
60+
} https://*.sentry.io https://vercel.live/ https://vercel.com https://*.googletagmanager.com`,
61+
`script-src 'self' 'unsafe-inline'${
62+
process.env.NODE_ENV === "development" ? " 'unsafe-eval'" : ""
63+
} https://*.sentry.io https://vercel.live/ https://vercel.com https://*.googletagmanager.com`,
6064
`style-src 'self' 'unsafe-inline'`,
6165
`font-src 'self'`,
6266
`form-action 'self'`,
63-
`connect-src 'self' https://*.sentry.io https://*.vercel.app https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com wss://*.pusher.com https://*.ldbar.ch`,
67+
`connect-src 'self' https://*.admin.ch https://*.sentry.io https://*.vercel.app https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com wss://*.pusher.com https://*.ldbar.ch`,
6468
`img-src 'self' https://vercel.live https://vercel.com *.pusher.com *.pusherapp.com https://*.admin.ch https://*.opendataswiss.org https://*.google-analytics.com https://*.googletagmanager.com data: blob:`,
65-
`script-src-elem 'self' 'unsafe-inline' https://*.admin.ch https://vercel.live https://vercel.com`,
69+
`script-src-elem 'self' 'unsafe-inline' https://*.admin.ch https://vercel.live https://vercel.com https://*.google-analytics.com https://*.analytics.google.com https://*.googletagmanager.com`,
6670
`worker-src 'self' blob: https://*.admin.ch`,
6771
].join("; "),
6872
});

0 commit comments

Comments
 (0)