@netlify/plugin-csp-nonce 1.2.12 → 1.2.13

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@netlify/plugin-csp-nonce",
4
- "version": "1.2.12",
4
+ "version": "1.2.13",
5
5
  "description": "Use a nonce for the script-src and style-src directives of your Content Security Policy.",
6
6
  "main": "index.js",
7
7
  "repository": {
@@ -24,11 +24,8 @@ const handler = async (request: Request, context: Context) => {
24
24
  // for debugging which routes use this edge function
25
25
  response.headers.set("x-debug-csp-nonce", "invoked");
26
26
 
27
- const isHTMLResponse = response.headers
28
- .get("content-type")
29
- ?.startsWith("text/html");
30
- const shouldTransformResponse = isHTMLResponse;
31
- if (!shouldTransformResponse) {
27
+ const isHTMLResponse = response.headers.get("content-type") === "text/html";
28
+ if (!isHTMLResponse) {
32
29
  console.log(`Unnecessary invocation for ${request.url}`, {
33
30
  method: request.method,
34
31
  "content-type": response.headers.get("content-type"),