@netlify/plugin-csp-nonce 1.3.1-alpha.2 → 1.3.4-alpha.1

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/index.js CHANGED
@@ -92,4 +92,15 @@ export const onPreBuild = async ({
92
92
  console.log(` Done.`);
93
93
  };
94
94
 
95
- export const onPreDev = onPreBuild;
95
+ export const onPreDev = async ({ inputs, netlifyConfig, utils, constants }) => {
96
+ if (!process.env.RUN_NETLIFY_CSP_NONCE_PLUGIN_TESTS) {
97
+ return;
98
+ }
99
+
100
+ return onPreBuild({
101
+ inputs,
102
+ netlifyConfig,
103
+ utils,
104
+ constants,
105
+ });
106
+ };
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "private": false,
3
3
  "name": "@netlify/plugin-csp-nonce",
4
- "version": "1.3.1-alpha.2",
4
+ "version": "1.3.4-alpha.1",
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": {
@@ -30,12 +30,12 @@ params.self = true;
30
30
  params.https = true;
31
31
  params.http = true;
32
32
 
33
- const handler = async (request: Request, context: Context) => {
34
- const response = await context.next(request);
33
+ const handler = async (_request: Request, context: Context) => {
34
+ const response = await context.next();
35
35
 
36
36
  // for debugging which routes use this edge function
37
37
  response.headers.set("x-debug-csp-nonce", "invoked");
38
- return csp(response, params)
38
+ return csp(response, params);
39
39
  };
40
40
 
41
41
  // Top 50 most common extensions (minus .html and .htm) according to Humio