fix: allow inline scripts in CSP for Next.js hydration
script-src 'self' was blocking all Next.js inline hydration scripts, preventing client-side JS from running. This caused fade-in items to stay at opacity:0 (empty grid). Added 'unsafe-inline' until Next.js App Router supports nonce-based CSP.
This commit is contained in:
@@ -4,7 +4,7 @@ import type { NextConfig } from 'next';
|
|||||||
// Locks down the public-facing site to only trusted sources.
|
// Locks down the public-facing site to only trusted sources.
|
||||||
const cspDirectives = [
|
const cspDirectives = [
|
||||||
"default-src 'self'",
|
"default-src 'self'",
|
||||||
"script-src 'self'",
|
"script-src 'self' 'unsafe-inline'",
|
||||||
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
"style-src 'self' 'unsafe-inline' https://fonts.googleapis.com",
|
||||||
"font-src 'self' https://fonts.gstatic.com",
|
"font-src 'self' https://fonts.gstatic.com",
|
||||||
"img-src 'self' data:",
|
"img-src 'self' data:",
|
||||||
|
|||||||
Reference in New Issue
Block a user