fix(csp): allow data: fonts, drop meta-ignored frame-ancestors#13
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.cssas adata:application/x-font-ttfURI, andfont-src 'self'blocked it:Fix:
font-src 'self' data:(same allowance already used forimg-src).2. Ignored directive (warning):
frame-ancestorsis header-only — it does nothing via<meta>and only logs a warning. Removed it; clickjacking protection viaframe-ancestors/X-Frame-Optionswould need a header-capable front (Cloudflare), which is noted in thehead.htmlcomment.Verified: build succeeds, the rendered CSP in
_siteshowsfont-src 'self' data:withframe-ancestorsgone, prettier clean.🤖 Generated with Claude Code