Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

helmet-csp

Package Overview
Dependencies
Maintainers
1
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

helmet-csp - npm Package Compare versions

Comparing version 2.7.0 to 2.7.1

11

lib/parse-dynamic-directives.js

@@ -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 @@ })

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc