Repository navigation
fix(csp): allow worker-src 'self' blob: for Clerk - #18
Merged
Merged
Conversation
Clerk creates Web Workers from blob: URLs. The policy had no worker-src, so browsers fell back to script-src, which does not allow blob:, and the console filled with CSP violations. Add worker-src 'self' blob: and leave every other directive unchanged (the pinned production policy in csp.test.ts gains exactly this directive).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
This branch was successfully deployed
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.
What
Add
worker-src 'self' blob:to the CSP built bysrc/lib/csp.ts, whichnext.config.tssets on every response. No other directive changes.Why
Clerk starts Web Workers from
blob:URLs. The policy had noworker-src, so browsers fell back toscript-src, which doesn't allowblob:, and the console logged blocked-worker errors.Verified
csp.test.ts: the pinned production policy gains exactly this directive, and a new test asserts it.npx vitest run(236 passed), eslint and tsc are clean.After merge
Nothing beyond the normal Vercel production deploy. The CSP is set at build time.