not-node 6.2.28 → 6.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "not-node",
3
- "version": "6.2.28",
3
+ "version": "6.3.0",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -8,25 +8,26 @@ module.exports = class InitSecurity {
8
8
  let CSPDirectives = config.get("CSP");
9
9
  let result = {};
10
10
  Object.keys(CSPDirectives).forEach((nm) => {
11
- result[nm + "Src"] = CSPDirectives[nm].join(" ");
12
- if (["default", "connect"].includes(nm)) {
13
- result[nm + "Src"] += " " + corsLine;
11
+ result[nm] = [...CSPDirectives[nm]];
12
+ if (
13
+ Array.isArray(corsArr) &&
14
+ ["default-src", "connect-src"].includes(nm)
15
+ ) {
16
+ result[nm].push(...corsLine);
14
17
  }
15
18
  });
16
19
  return result;
17
20
  } catch (e) {
18
- Log.error(e);
21
+ Log && Log.error(e);
19
22
  return {};
20
23
  }
21
24
  }
22
25
 
23
- async run({ master, config, options }) {
26
+ async run({ master, config }) {
24
27
  //adding protection
25
28
  const helmet = require("helmet");
26
29
  const CSPDirectives = this.getCSPDirectives({
27
- options,
28
30
  config,
29
- master,
30
31
  });
31
32
  master.getServer().use(
32
33
  helmet({