Need help with fastify-helmet?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

fastify
146 Stars 22 Forks Other 116 Commits 1 Opened issues

Description

Important security headers for Fastify

Services available

!
?

Need anything else?

Contributors list

fastify-helmet

npm version CI workflow Known Vulnerabilities Coverage Status js-standard-style

Important security headers for Fastify. It is a tiny wrapper around helmet.

Install

npm i fastify-helmet

Usage

Simply require this plugin, and the basic security headers will be set.

const fastify = require('fastify')()
const helmet = require('fastify-helmet')

fastify.register( helmet, // Example disables the contentSecurityPolicy middleware but keeps the rest. { contentSecurityPolicy: false } )

fastify.listen(3000, err => { if (err) throw err })

How it works

fastify-helmet
is just a tiny wrapper around helmet that adds an
'onRequest'
hook. It accepts the same options of Helmet, and you can see more in the helmet documentation.

License

MIT

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.