helmet-csp
Advanced tools
Changelog
4.0.0 - 2020-08-02
See the Helmet 4 upgrade guide for help upgrading from Helmet 3.
helmet.contentSecurityPolicy
:
default-src
directive is supplied, an error is thrownhelmet.contentSecurityPolicy
:
helmet.xssFilter
now disables the buggy XSS filter by default. See #230helmet.featurePolicy
. If you still need it, use the feature-policy
package on npm.helmet.hpkp
. If you still need it, use the hpkp
package on npm.helmet.noCache
. If you still need it, use the nocache
package on npm.helmet.contentSecurityPolicy
:
browserSniff
and disableAndroid
parameters). See helmetjs/csp#97reportOnly
. Read this if you need help.setAllHeaders
parameter). Read this if you need help.loose
optionhelmet.frameguard
:
ALLOW-FROM
action. Read more here.helmet.hidePoweredBy
no longer accepts arguments. See this article to see how to replicate the removed behavior. See #224.helmet.hsts
:
includeSubdomains
with a lowercase D. See #231setIf
. Read this if you need help. See #232helmet.xssFilter
no longer accepts options. Read "How to disable blocking with X-XSS-Protection" and "How to enable the report
directive with X-XSS-Protection" if you need the legacy behavior.Changelog
3.3.0 - 2016-12-31
referrerPolicy
allows strict-origin
and strict-origin-when-cross-origin
directivesconnect
versionChangelog
3.0.0 - 2016-10-28
csp
will check your directives for common mistakes and throw errors if it finds them. This can be disabled with loose: true
.csp
. For source lists (like script-src
or object-src
), use the standard scriptSrc: ["'none'"]
. The sandbox
directive can be sandbox: true
to block everything.false
can disable a CSP directive. For example, scriptSrc: false
is the same as not specifying it.reportOnly: true
no longer requires a report-uri
to be set.hsts
's maxAge
now defaults to 180 days (instead of 1 day)hsts
's maxAge
parameter is seconds, not millisecondshsts
includes subdomains by defaultdomain
parameter in frameguard
cannot be emptynoEtag
option no longer present in noCache
connect-src
workaround in CSP module