Skip to content

Commit 4572cdc

Browse files
committed
chore: move nonce before strict-dynamic
1 parent 7bb3eda commit 4572cdc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lambda/nonce-injector/index.js.tpl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ function rewriteCsp(contentSecurityPolicy, nonce, request) {
9797
// Remove 'self'
9898
value = value.replaceAll("'self'", '').trim();
9999
// 'unsafe-inline' is ignored if nonces are supported.
100-
value = `'strict-dynamic' 'nonce-$${nonce}' $${value}`;
100+
value = ` 'nonce-$${nonce}' 'strict-dynamic' $${value}`;
101101
policies[i] = `$${key} $${value.trim()}`;
102102
} else if (key == 'style-src' && injectStyleNonces) {
103103
value = `'nonce-$${nonce}' $${value}`

0 commit comments

Comments
 (0)