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 1.0.0 to 1.0.1

2

index.js

@@ -26,2 +26,4 @@ var camelize = require('camelize')

browser = platform.parse(userAgent)
} else {
browser = {}
}

@@ -28,0 +30,0 @@

2

package.json

@@ -8,3 +8,3 @@ {

"description": "Content Security Policy middleware.",
"version": "1.0.0",
"version": "1.0.1",
"license": "MIT",

@@ -11,0 +11,0 @@ "keywords": [

@@ -95,2 +95,16 @@ var csp = require('..')

it('sets all the headers if there is no user-agent', function (done) {
var app = use({
directives: {
defaultSrc: ["'self'", 'domain.com']
}
})
request(app).get('/').unset('User-Agent')
.expect('X-Content-Security-Policy', "default-src 'self' domain.com")
.expect('Content-Security-Policy', "default-src 'self' domain.com")
.expect('X-WebKit-CSP', "default-src 'self' domain.com")
.end(done)
})
it('can set the report-only headers', function (done) {

@@ -97,0 +111,0 @@ var app = use({

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