We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 61387e9 + 539f01c commit ae7cb11Copy full SHA for ae7cb11
CHANGELOG.md
@@ -1,3 +1,7 @@
1
+##### v1.5.2
2
+
3
+* Bugfix: Add style/script directive if nonce is true
4
5
##### v1.5.1
6
7
* Bugfix: style-src nonce updates properly, speed improvement on match
lib/csp.js
@@ -19,6 +19,16 @@ module.exports = function (options) {
19
name += '-report-only';
20
}
21
22
+ if (policyRules && policyRules["default-src"]) {
23
+ if (styleNonce && !policyRules["style-src"]) {
24
+ policyRules["style-src"] = policyRules["default-src"];
25
+ }
26
27
+ if (scriptNonce && !policyRules["script-src"]) {
28
+ policyRules["script-src"] = policyRules["default-src"];
29
30
31
32
value = createPolicyString(policyRules);
33
34
if (reportUri) {
0 commit comments