NetEscapades.AspNetCore.SecurityHeaders 0.9.0

Middleware for ASP.NET Core to automatically add security headers to requests.

Install-Package NetEscapades.AspNetCore.SecurityHeaders -Version 0.9.0
dotnet add package NetEscapades.AspNetCore.SecurityHeaders --version 0.9.0
<PackageReference Include="NetEscapades.AspNetCore.SecurityHeaders" Version="0.9.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add NetEscapades.AspNetCore.SecurityHeaders --version 0.9.0
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

Release Notes


* Add support for Nonce generation for Content-Security-Policy headers. See for details
* Add TagHelpers library for adding nonces and generating hashes for Razor elements (
* Allow using HSTS preload with Strict-Transport-Security
* Allow excluding domains from Strict-Transport-Security. Similar to the Microsoft HstsMiddlewareyou can skip applying Strict-Transport-Security to specific hosts

Breaking Changes:

* All obsolete classes have been removed.
* Many classes have changed namespace to better reflect their location in the project, and also to aid discovery. If you're using the recommended builders and extension methods, you should not have any build-time breaking changes, but the package is not runtime-compatible with previous versions
* The Strict-Transport-Security header is no longer applied to localhost by default. Generally speaking, this isn't something you should do anyway.
* The CSP classes have undergone significant refactoring to allow dynamic values per-request (i.e. nonces). This doesn't affect the main public API, but will impact you if you're working with the low-level infrastructure classes.

See for more details.

Version History

Version Downloads Last updated
0.9.0 67,707 10/28/2018
0.8.0 3,234 10/10/2018
0.7.1 5,805 8/29/2018
0.7.0 32,254 1/14/2018
0.6.0 2,140 12/11/2017
0.5.0 673 12/5/2017
0.4.1 22,547 9/27/2017
0.3.1 33,738 4/14/2017
0.3.0 5,858 3/1/2017
0.2.1 12,957 9/14/2016
0.1.1 670 8/12/2016
0.1.0 389 8/2/2016
0.1.0-beta-0003 296 6/2/2016