helmet-csp
Advanced tools
Comparing version 2.7.0 to 2.7.1
@@ -1,6 +0,9 @@ | ||
var reduce = require('lodash.reduce') | ||
var isFunction = require('./is-function') | ||
module.exports = function parseDynamicDirectives (directives, functionArgs) { | ||
return reduce(directives, function (result, value, key) { | ||
var result = {} | ||
Object.keys(directives).forEach(function (key) { | ||
var value = directives[key] | ||
if (Array.isArray(value)) { | ||
@@ -19,5 +22,5 @@ result[key] = value.map(function (element) { | ||
} | ||
}) | ||
return result | ||
}, {}) | ||
return result | ||
} |
@@ -1,5 +0,7 @@ | ||
var reduce = require('lodash.reduce') | ||
function createFirefoxPreCSP10Directives (directives, basePolicy) { | ||
var result = Object.assign({}, basePolicy) | ||
function createFirefoxPreCSP10Directives (directives, basePolicy) { | ||
return reduce(directives, function (result, value, key) { | ||
Object.keys(directives).forEach(function (key) { | ||
var value = directives[key] | ||
if (key === 'connectSrc') { | ||
@@ -25,5 +27,5 @@ result.xhrSrc = value | ||
} | ||
}) | ||
return result | ||
}, basePolicy) | ||
return result | ||
} | ||
@@ -30,0 +32,0 @@ |
@@ -9,3 +9,3 @@ { | ||
"description": "Content Security Policy middleware.", | ||
"version": "2.7.0", | ||
"version": "2.7.1", | ||
"license": "MIT", | ||
@@ -37,3 +37,2 @@ "keywords": [ | ||
"dasherize": "2.0.0", | ||
"lodash.reduce": "4.6.0", | ||
"platform": "1.3.5" | ||
@@ -43,7 +42,7 @@ }, | ||
"content-security-policy-parser": "^0.1.1", | ||
"express": "^4.16.2", | ||
"lodash": "^4.16.4", | ||
"mocha": "^5.0.0", | ||
"standard": "^10.0.3", | ||
"supertest": "^3.0.0" | ||
"express": "^4.16.3", | ||
"lodash": "^4.17.10", | ||
"mocha": "^5.2.0", | ||
"standard": "^11.0.1", | ||
"supertest": "^3.1.0" | ||
}, | ||
@@ -50,0 +49,0 @@ "standard": { |
@@ -117,6 +117,6 @@ Content Security Policy middleware | ||
```js | ||
var uuid = require('node-uuid') | ||
var uuidv4 = require('uuid/v4') | ||
app.use(function (req, res, next) { | ||
res.locals.nonce = uuid.v4() | ||
res.locals.nonce = uuidv4() | ||
next() | ||
@@ -123,0 +123,0 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4
473
24588
- Removedlodash.reduce@4.6.0
- Removedlodash.reduce@4.6.0(transitive)