Skip to content

Commit

Permalink
Update csp_nonce.js
Browse files Browse the repository at this point in the history
  • Loading branch information
jmrplens authored Jun 4, 2023
1 parent 35e25a6 commit c2550d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion js/csp_nonce.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ app.get('/', function(request, response) {
// Generate a new random nonce value for every response.
const nonce = crypto.randomBytes(16).toString("base64");
// Set the strict nonce-based CSP response header
const csp = `script-src 'nonce-${nonce}' 'strict-dynamic' https: static.cloudflareinsights.com; connect-src cloudflareinsights.com; object-src 'none'; base-uri 'none';`;
const csp = `script-src 'nonce-${nonce}' 'strict-dynamic' static.cloudflareinsights.com; connect-src cloudflareinsights.com; object-src 'none'; base-uri 'none';`;
response.set("Content-Security-Policy", csp);
// Every <script> tag in your application should set the `nonce` attribute to this value.
response.render(template, { nonce: nonce });
Expand Down

0 comments on commit c2550d4

Please sign in to comment.