fix: allow Google Fonts in CSP
All checks were successful
CI / nightly-e2e (pull_request) Has been skipped
CI / deploy (pull_request) Has been skipped
CI / pr-e2e (pull_request) Successful in 1m8s
CI / ci (pull_request) Successful in 1m25s

style-src and font-src were 'self' only, blocking fonts.googleapis.com
stylesheet and fonts.gstatic.com font files. Add both origins so
Space Grotesk, Inter and Fira Code load correctly in production.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
codex_a
2026-03-01 11:31:41 +00:00
parent ec89a5fe35
commit 78c4313874

View File

@@ -25,9 +25,9 @@ class SecurityHeadersMiddleware:
response["Content-Security-Policy"] = ( response["Content-Security-Policy"] = (
f"default-src 'self'; " f"default-src 'self'; "
f"script-src 'self' 'nonce-{nonce}'; " f"script-src 'self' 'nonce-{nonce}'; "
"style-src 'self'; " "style-src 'self' https://fonts.googleapis.com; "
"img-src 'self' data: blob:; " "img-src 'self' data: blob:; "
"font-src 'self'; " "font-src 'self' https://fonts.gstatic.com; "
"connect-src 'self'; " "connect-src 'self'; "
"object-src 'none'; " "object-src 'none'; "
"base-uri 'self'; " "base-uri 'self'; "