-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: csp nonce in
script-src-elem
, style-src-attr
and `style-src-…
…elem` when using unsafe-inline (#11613) * add nonce to script-src-elem csp directive if defined * added changeset * also handle hashes and style-src-attr and style-src-elem * changed order of variable declaration * fixed typo * updated changeset * fix bug and update test * update test * write better tests and fix bugs * Update .changeset/giant-years-drum.md * fix csp nonce in script-src-elem, style-src-attr and style-src-elem when using unsafe-inline * fix test desc * Update giant-years-drum.md * refactor * rename variable * avoid duplicate empty comment hash * add back removed test * added back another test * add back skips nonce in style-src when using unsafe-inline test * put tests in same order --------- Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Chew Tee Ming <[email protected]>
- Loading branch information
1 parent
c717db9
commit 6df00fc
Showing
3 changed files
with
117 additions
and
67 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"@sveltejs/kit": patch | ||
--- | ||
|
||
fix: only add nonce to `script-src-elem`, `style-src-attr` and `style-src-elem` CSP directives when `unsafe-inline` is not present |
This file contains 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
This file contains 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