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
// Cloudflare Worker script to apply a dynamic Content-Security-Policy header | |
// for each fetch request by: | |
// | |
// 1. generating a per-request nonce; | |
// | |
// 2. injecting it into the "nonce" attribute on all SCRIPT and STYLE elements; | |
// and | |
// | |
// 3. adding a Content-Security-Policy allowing that nonce in the "script-src" | |
// and "style-src" attributes. |
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
1.3.1 |