@netlify/plugin-csp-nonce 1.4.0 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/manifest.yml +3 -0
- package/package.json +1 -1
- package/src/__csp-nonce.ts +1 -1
package/manifest.yml
CHANGED
|
@@ -5,6 +5,9 @@ inputs:
|
|
|
5
5
|
default: true
|
|
6
6
|
- name: reportUri
|
|
7
7
|
description: The relative or absolute URL to report any violations. If not defined, violations are reported to the __csp-violations function, which this plugin deploys.
|
|
8
|
+
- name: strictDynamic
|
|
9
|
+
description: When true, dynamically trust scripts via nonce or hash instead of static allowlists, enhancing security.
|
|
10
|
+
default: true
|
|
8
11
|
- name: unsafeEval
|
|
9
12
|
description: When true, adds 'unsafe-eval' to CSP for easier adoption. Set to false to have a safer policy if your code and code dependencies does not use eval().
|
|
10
13
|
default: true
|
package/package.json
CHANGED
package/src/__csp-nonce.ts
CHANGED
|
@@ -24,7 +24,7 @@ params.reportUri = params.reportUri || "/.netlify/functions/__csp-violations";
|
|
|
24
24
|
// @ts-ignore
|
|
25
25
|
params.distribution = Netlify.env.get("CSP_NONCE_DISTRIBUTION");
|
|
26
26
|
|
|
27
|
-
params.strictDynamic = true;
|
|
27
|
+
params.strictDynamic = params.strictDynamic ?? true;
|
|
28
28
|
params.unsafeInline = params.unsafeInline ?? true;
|
|
29
29
|
params.self = params.self ?? true;
|
|
30
30
|
params.https = true;
|