Skip to content

fix(csp): allow data: fonts, drop meta-ignored frame-ancestors#13

Merged
jansroka merged 1 commit into
mainfrom
fix-csp-font-src
Jul 8, 2026
Merged

fix(csp): allow data: fonts, drop meta-ignored frame-ancestors#13
jansroka merged 1 commit into
mainfrom
fix-csp-font-src

Conversation

@jansroka

@jansroka jansroka commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Fixes two Content-Security-Policy console messages reported in the browser after PR #6 shipped the CSP.

1. Blocked font (error): the Webflow icon font is embedded in webflow.css as a data:application/x-font-ttf URI, and font-src 'self' blocked it:

The page's settings blocked the loading of a resource (font-src) at data:application/x-font-ttf… because it violates the following directive: "font-src 'self'"

Fix: font-src 'self' data: (same allowance already used for img-src).

2. Ignored directive (warning):

Ignoring source 'frame-ancestors' (Not supported when delivered via meta element).

frame-ancestors is header-only — it does nothing via <meta> and only logs a warning. Removed it; clickjacking protection via frame-ancestors/X-Frame-Options would need a header-capable front (Cloudflare), which is noted in the head.html comment.

Verified: build succeeds, the rendered CSP in _site shows font-src 'self' data: with frame-ancestors gone, prettier clean.

🤖 Generated with Claude Code

Two Content-Security-Policy console messages in the browser:

1. ERROR — a Webflow icon font embedded in webflow.css as a
   data:application/x-font-ttf URI was blocked by `font-src 'self'`. Add
   `data:` to font-src (mirrors the existing img-src 'self' data:).

2. WARNING — `frame-ancestors` is ignored when delivered via <meta> (it is
   header-only), so it did nothing but log a warning. Removed it; X-Frame-
   Options / a header-based frame-ancestors would need a header-capable front
   (documented in the head.html comment).

Verified: site builds and the rendered CSP in _site shows
`font-src 'self' data:` with frame-ancestors gone; prettier clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jansroka jansroka merged commit 6a5747a into main Jul 8, 2026
1 check passed
@jansroka jansroka deleted the fix-csp-font-src branch July 8, 2026 19:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant