File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -12,16 +12,18 @@ const PUBLIC_FILE = /\.[^/]+$/
1212const LOCALE_COOKIE_MAX_AGE = 60 * 60 * 24 * 365
1313
1414function applySecurityHeaders ( response : NextResponse , isDev : boolean ) : NextResponse {
15+ const analyticsHosts = "https://www.googletagmanager.com https://www.google-analytics.com https://region1.google-analytics.com"
16+
1517 const connectSrc = isDev
16- ? " 'self' http://localhost:8080"
17- : " 'self'"
18+ ? ` 'self' http://localhost:8080 ${ analyticsHosts } `
19+ : ` 'self' ${ analyticsHosts } `
1820
1921 const cspDirectives = [
2022 "default-src 'self'" ,
21- " script-src 'self' 'unsafe-inline' 'unsafe-eval'" ,
23+ ` script-src 'self' 'unsafe-inline' 'unsafe-eval' https://www.googletagmanager.com` ,
2224 "style-src 'self' 'unsafe-inline' https://fonts.googleapis.com" ,
2325 "font-src 'self' https://fonts.gstatic.com" ,
24- "img-src 'self' data: blob: https://avatars.githubusercontent.com https://github.com" ,
26+ "img-src 'self' data: blob: https://avatars.githubusercontent.com https://github.com https://www.google-analytics.com " ,
2527 `connect-src ${ connectSrc } ` ,
2628 "frame-ancestors 'none'" ,
2729 "base-uri 'self'" ,
You can’t perform that action at this time.
0 commit comments