@netlify/plugin-csp-nonce 1.3.8 → 1.4.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 +6 -0
- package/package.json +1 -1
- package/src/__csp-nonce.ts +3 -3
package/manifest.yml
CHANGED
|
@@ -14,3 +14,9 @@ inputs:
|
|
|
14
14
|
- name: excludedPath
|
|
15
15
|
description: The glob expressions of path(s) that *should not* invoke the CSP nonce edge function. Must be an array of strings. This value gets spread with common non-html filetype extensions (*.css, *.js, *.svg, etc)
|
|
16
16
|
default: []
|
|
17
|
+
- name: unsafeInline
|
|
18
|
+
description: When true, allows the execution of inline scripts, such as those defined within <script> tags or through onclick attributes.
|
|
19
|
+
default: true
|
|
20
|
+
- name: self
|
|
21
|
+
description: When true, restricts the execution of scripts to those that originate from the same origin (protocol, domain, and port) as the document.
|
|
22
|
+
default: true
|
package/package.json
CHANGED
package/src/__csp-nonce.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// @ts-ignore
|
|
3
3
|
import type { Config, Context } from "netlify:edge";
|
|
4
4
|
// @ts-ignore
|
|
5
|
-
import { csp } from "https://deno.land/x/csp_nonce_html_transformer@v2.2.
|
|
5
|
+
import { csp } from "https://deno.land/x/csp_nonce_html_transformer@v2.2.2/src/index-embedded-wasm.ts";
|
|
6
6
|
// @ts-ignore
|
|
7
7
|
import inputs from "./__csp-nonce-inputs.json" assert { type: "json" };
|
|
8
8
|
|
|
@@ -25,8 +25,8 @@ params.reportUri = params.reportUri || "/.netlify/functions/__csp-violations";
|
|
|
25
25
|
params.distribution = Netlify.env.get("CSP_NONCE_DISTRIBUTION");
|
|
26
26
|
|
|
27
27
|
params.strictDynamic = true;
|
|
28
|
-
params.unsafeInline = true;
|
|
29
|
-
params.self = true;
|
|
28
|
+
params.unsafeInline = params.unsafeInline ?? true;
|
|
29
|
+
params.self = params.self ?? true;
|
|
30
30
|
params.https = true;
|
|
31
31
|
params.http = true;
|
|
32
32
|
|