fix: add static.cloudflareinsights.com to CSP script-src (#7178)

PR #7178 — The CSP was blocking the Cloudflare Web Analytics beacon
(static.cloudflareinsights.com). Both dev and prod script-src directives
need the domain for the analytics script to load.

Co-authored-by: oyi77 <oyi77@users.noreply.github.com>
This commit is contained in:
Paijo
2026-07-18 21:34:10 +07:00
committed by GitHub
parent f287f42f15
commit a02fa3818b

View File

@@ -9,8 +9,8 @@ const distDir = process.env.NEXT_DIST_DIR || ".build/next";
const projectRoot = dirname(fileURLToPath(import.meta.url));
const scriptSrc =
process.env.NODE_ENV === "development"
? "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:"
: "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob:";
? "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://static.cloudflareinsights.com"
: "script-src 'self' 'unsafe-inline' 'unsafe-eval' blob: https://static.cloudflareinsights.com";
const contentSecurityPolicy = [
"default-src 'self'",
"base-uri 'self'",