Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Apply review comment to simplify nonce_attr assignment
Browse files Browse the repository at this point in the history
  • Loading branch information
hanschua committed Sep 22, 2020
1 parent 366b0b2 commit 0ccc479
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion runtime/src/server/middleware/get_page_handler.ts
Expand Up @@ -299,8 +299,8 @@ export function get_page_handler(
const main = `${req.baseUrl}/client/${file}`;

// users can set a CSP nonce using res.locals.nonce
const nonce_attr = (res.locals && res.locals.nonce) ? ` nonce="${res.locals.nonce}"` : '';
const nonce_value = (res.locals && res.locals.nonce) ? res.locals.nonce : '';
const nonce_attr = nonce_value ? ` nonce="${nonce_value}"` : '';

if (build_info.bundler === 'rollup') {
if (build_info.legacy_assets) {
Expand Down

0 comments on commit 0ccc479

Please sign in to comment.