Content-Security-Policy gives a better error when a directive value, like self, should be quoted. See #482Strict-Transport-Security now has a max-age of 365 days, up from 180Content-Security-Policy middleware now throws an error if a directive should have quotes but does not, such as self instead of 'self'. See #454Content-Security-Policy's getDefaultDirectives now returns a deep copy. This only affects users who were mutating the resultStrict-Transport-Security now throws an error when "includeSubDomains" option is misspelled. This was previously a warningContent-Security-Policy middleware now warns if a directive should have quotes but does not, such as self instead of 'self'. This will be an error in future versions. See #454helmet.crossOriginEmbedderPolicy now supports the unsafe-none directive. See #477Cross-Origin-Embedder-Policy middleware is now disabled by default. See #411Expect-CT is no longer part of Helmet. If you still need it, you can use the expect-ct package. See #378strictTransportSecurity for the Strict-Transport-Security header, instead of hsts)main to package to help with some build toolscrossOriginEmbedderPolicy did not accept options at the top level. See #390helmet.contentSecurityPolicy no longer sets block-all-mixed-content directive by defaulthelmet.expectCt is no longer set by default. It can, however, be explicitly enabled. It will be removed in Helmet 7. See #310helmet.frameguard no longer offers a specific error when trying to use ALLOW-FROM; it just says that it is unsupported. Only the error message has changedCross-Origin-Embedder-Policy: support credentialless policy. See #365Content-Security-Policy and Content-Security-Policy-Report-OnlyOrigin-Agent-Clusterimport helmet from "helmet" and import { frameguard } from "helmet"). See #320helmet.contentSecurityPolicy: useDefaults option now defaults to truehelmet.contentSecurityPolicy: form-action directive is now set to 'self' by defaulthelmet.crossOriginEmbedderPolicy is enabled by defaulthelmet.crossOriginOpenerPolicy is enabled by defaulthelmet.crossOriginResourcePolicy is enabled by defaulthelmet.originAgentCluster is enabled by defaulthelmet.frameguard: add TypeScript editor autocomplete. See #322helmet() function is slightly fasterhelmet.contentSecurityPolicy: the useDefaults option, defaulting to false, lets you selectively override defaults more easilypackage.json. See #303helmet.crossOriginEmbedderPolicy: a new middleware for the Cross-Origin-Embedder-Policy header, disabled by defaulthelmet.crossOriginOpenerPolicy: a new middleware for the Cross-Origin-Opener-Policy header, disabled by defaulthelmet.crossOriginResourcePolicy: a new middleware for the Cross-Origin-Resource-Policy header, disabled by defaulttrue enables a middleware with default options. Previously, this would fail with an error if the middleware was already enabled by default.originAgentCluster at the top levelhelmet.originAgentCluster: a new middleware for the Origin-Agent-Cluster header, disabled by defaulthelmet.contentSecurityPolicy: broken TypeScript types. See #283helmet.contentSecurityPolicy: setting the default-src to helmet.contentSecurityPolicy.dangerouslyDisableDefaultSrc disables ithelmet.frameguard: slightly improved error messages for non-stringshelmet.contentSecurityPolicy: get the default directives with contentSecurityPolicy.getDefaultDirectives()helmet() now supports objects that don't have Object.prototype in their chain, such as Object.create(null), as optionshelmet.expectCt: max-age is now first. See #264helmet.contentSecurityPolicy:
HelmetOptions interface is no longer exported. This only affects TypeScript users. If you need the functionality back, see this commentSee 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.helmet.expectCt is no longer a separate package. This should have no effect on end users.helmet.frameguard is no longer a separate package. This should have no effect on end users.helmet.dnsPrefetchControl is no longer a separate package. This should have no effect on end users.helmet.ieNoOpen is no longer a separate package. This should have no effect on end users.helmet.featurePolicy is deprecated. Use the feature-policy module instead.helmet-csp to v2.10.0
allow-downloads sandbox directive. See helmet-csp#103helmet.noCache is deprecated. Use the nocache module instead. See #215helmet-csp to v2.9.5
bowser subdependency from 2.7.0 to 2.9.0bowser subdependency. See helmet-csp#96 and #101helmet-csp to v2.9.4
bowser subdependency from 2.6.1 to 2.7.0. See helmet-csp#94helmet-csp to v2.9.2
default-src from future responsesbowser subdependency to latest versionx-xss-protection to v1.3.0
mode: null to disable mode=blockhelmet-csp to v2.9.1
bowser subdependency from 2.5.3 to 2.5.4. See helmet-csp#88helmet-csp to v2.9.0helmet-csp to v2.8.0dns-prefetch-control to v0.2.0dont-sniff-mimetype to v1.1.0helmet-crossdomain to v0.4.0hide-powered-by to v1.1.0x-xss-protection to v1.2.0featurePolicy has 19 new features: ambientLightSensor, documentDomain, documentWrite, encryptedMedia, fontDisplayLateSwap, layoutAnimations, legacyImageFormats, loadingFrameDefaultEager, oversizedImages, pictureInPicture, serial, syncScript, unoptimizedImages, unoptimizedLosslessImages, unoptimizedLossyImages, unsizedMedia, verticalScroll, wakeLock, and xrexpect-ct to v0.2.0feature-policy to v0.3.0frameguard to v3.1.0nocache to v2.1.0referrerPolicy now supports multiple valuesreferrerPolicy to v1.2.0bugs field in package.jsonhsts to v2.2.0ienoopen to v1.1.0helmet.hsts's setIf option has been deprecated and will be removed in hsts@3. See helmetjs/hsts#22 for more
The includeSubdomains option (with a lowercase d) has been deprecated and will be removed in hsts@3. Use the uppercase-D includeSubDomains option instead. See helmetjs/hsts#21 for more
hpkp middleware has been deprecated. If you still need to use this module, install the standalone hpkp module from npm. See #180 for more.helmet.featurePolicy now supports four new featureshelmet.featurePolicy middlewarehelmet.permittedCrossDomainPolicies middlewarelodash.reduce dependency from cspexpectCt should use comma instead of semicolon as delimiterxssFilter now supports reportUri optioncsp now supports prefix-src directivecsp no longer loads JSON files internally, helping some module bundlersfalse should be able to disable a CSP directivecsp now supports strict-dynamic valuecsp now supports require-sri-for directiveconnect dependencyconnect dependency to latestcsp does not automatically set report-to when setting report-urihsts no longer cares whether it's HTTPS and always sets the headercsp now supports report-to directivenpmignoreconnect versionexpectCt middleware for setting the Expect-CT headercsp now supports the worker-src directiveconnect versioncsp now supports more sandbox directivesreferrerPolicy allows strict-origin and strict-origin-when-cross-origin directivesconnect versioncsp now allows manifest-src directivecsp now allows frame-src directivecsp 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 noCacheconnect-src workaround in CSP modulehpkp middleware now supports the includeSubDomains property with a capital Dhpkp was setting includeSubdomains instead of includeSubDomainsreferrerPolicy middlewarehelmet.xssFilter) are no longer dynamically requirednocache's noEtag option is now deprecatedcsp now better handles Firefox on mobilehelmet-cspframeguard had a documentation error about its default valueframeguard docs in main Helmet readme said frameguard, not helmet.frameguardcsp lets you dynamically set reportOnlydnsPrefetchControl middleware is now enabled by defaultframeguard can no longer be initialized with strings; you must use an objecthpkp lowercase in documentationhpkp spec URL in readmesframeguard header name in readmehpkp has a setIf option to conditionally set the headercsp now has a browserSniff option to disable all user-agent sniffingframeguard can now be initialized with optionsnpmignore file to speed up installs slightlydnsPrefetchControl middlewarecsp readme had syntax errorscsp wouldn't recognize IE Mobile browserscsp had some errors in its readmecsp with no User Agent would cause errorscsp module supports dynamically-generated valuescsp directives are now under the directives keyhpkp's Report-Only header is now opt-in, not opt-outcrossdomain middlewarecsp no longer throws errors when some directives aren't quoted ('self', for example)maxage option in the hpkp middlewaresafari5 option from csp moduleunsafe-inline and unsafe-evalcsp policies is no longer recursivehpkp allows a report-uri without the Report-Only headernocache now sends the Surrogate-Control headernocache no longer contains the private directive in the Cache-Control headerxssFilter now has a function nameincludeSubdomains to includeSubDomainscsp now supports Microsoft Edgeconnect to 3.4.0depd to 1.1.0license key to csp's package.jsoncsp directives now support every directive, not just sandboxcsp readmepackage.jsonhpkp had a link to the wrong place in its readmehpkp requires 2 or more pinshpkp might have miscalculated maxAge slightly wrongnocache adds private to its Cache-Control directivepackage.jsoncrossdomain middlewarecrossdomain is no longer a default middlewarehpkp middlewarexssFilter performanceframeguard middleware exported a function called xframecsp for Androidcsp on Chrome Mobile on Android and iOSnocache should force revalidationplatform version in CSP and X-XSS-Protectioncsp bugfixespackage.json for new URLxframe now called frameguard (though xframe still works)frameguard chooses sameorigin by defaultframeguard understands "SAME-ORIGIN" in addition to "SAMEORIGIN"nocache removed from default middleware stacknocache now sets the Expires and Pragma headersnocache now allows you to crush ETagshelmet() was having issuesThis changelog was created after the release of 0.3.1.