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

fastify-helmet

Package Overview
Dependencies
Maintainers
12
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-helmet - npm Package Compare versions

Comparing version 5.1.0 to 5.2.0

2

index.js

@@ -18,1 +18,3 @@ 'use strict'

})
module.exports.contentSecurityPolicy = helmet.contentSecurityPolicy

2

package.json
{
"name": "fastify-helmet",
"version": "5.1.0",
"version": "5.2.0",
"description": "Important security headers for Fastify",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -110,1 +110,28 @@ 'use strict'

})
test('default CSP directives can be accessed through plugin export', (t) => {
const fastify = Fastify()
fastify.register(helmet, {
contentSecurityPolicy: {
directives: {
...helmet.contentSecurityPolicy.getDefaultDirectives()
}
}
})
fastify.get('/', (request, reply) => {
reply.send({ hello: 'world' })
})
fastify.inject({
method: 'GET',
url: '/'
}, (err, res) => {
t.error(err)
const expected = { 'content-security-policy': 'default-src \'self\';base-uri \'self\';block-all-mixed-content;font-src \'self\' https: data:;frame-ancestors \'self\';img-src \'self\' data:;object-src \'none\';script-src \'self\';script-src-attr \'none\';style-src \'self\' https: \'unsafe-inline\';upgrade-insecure-requests' }
t.include(res.headers, expected)
t.end()
})
})
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