Eigenverft.WebLib.Hsts
1.0.0.5-g40a2f17cdc
dotnet add package Eigenverft.WebLib.Hsts --version 1.0.0.5-g40a2f17cdc
NuGet\Install-Package Eigenverft.WebLib.Hsts -Version 1.0.0.5-g40a2f17cdc
<PackageReference Include="Eigenverft.WebLib.Hsts" Version="1.0.0.5-g40a2f17cdc" />
<PackageVersion Include="Eigenverft.WebLib.Hsts" Version="1.0.0.5-g40a2f17cdc" />
<PackageReference Include="Eigenverft.WebLib.Hsts" />
paket add Eigenverft.WebLib.Hsts --version 1.0.0.5-g40a2f17cdc
#r "nuget: Eigenverft.WebLib.Hsts, 1.0.0.5-g40a2f17cdc"
#:package Eigenverft.WebLib.Hsts@1.0.0.5-g40a2f17cdc
#addin nuget:?package=Eigenverft.WebLib.Hsts&version=1.0.0.5-g40a2f17cdc&prerelease
#tool nuget:?package=Eigenverft.WebLib.Hsts&version=1.0.0.5-g40a2f17cdc&prerelease
Eigenverft.WebLib.Hsts
A small registration and environment-aware activation wrapper around ASP.NET Coreโs native HSTS middleware.
โจ At a glance
| Capability | What it does |
|---|---|
| AddWebLibHsts() | Registers native HSTS with a 180-day max-age baseline and binds Hsts configuration. |
| AddWebLibHsts(Action<HstsOptions>) | Applies code overrides after configuration binding. |
| UseWebLibHsts() | Uses native HSTS outside Development and is a no-op in Development. |
๐ฆ Installation
dotnet add package Eigenverft.WebLib.Hsts
๐ Quick start
Register and activate native HSTS
using System;
using Eigenverft.WebLib.Hsts;
using Microsoft.AspNetCore.Builder;
builder.Services.AddWebLibHsts(options =>
{
options.MaxAge = TimeSpan.FromDays(180);
});
WebApplication app = builder.Build();
app.UseWebLibHsts();
app.Run();
Package behavior
The wrapper uses ASP.NET Core HstsOptions and native UseHsts behavior. Its max-age baseline is 180 days. Native defaults remain in effect for IncludeSubDomains, Preload, and excluded hosts unless you configure them.
Options bind from the Hsts configuration section. When using the Action overload, the callback runs after configuration binding, so code values take precedence. UseWebLibHsts() skips middleware in Development; in other environments the native middleware emits the header only for HTTPS requests and retains ASP.NET Coreโs excluded-host behavior.
Place UseWebLibHsts() early enough to wrap responses that may short-circuit later, including health probes and rate-limit rejections.
๐ฏ Target frameworks
Targets .NET 8 and .NET 10. A .NET 9 application can consume the compatible net8.0 asset.
๐ Project links
๐ License
Licensed under the MIT License by Eigenverft.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
-
net8.0
- No dependencies.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 1.0.0.5-g40a2f17cdc | 0 | 9/28/2026 |
| 1.0.0.5-g3f72d1412c | 0 | 9/29/2026 |
| 1.0.0.2-gbfce1c5596 | 0 | 9/28/2026 |
| 1.0.0.2-g8afd56e9dc | 0 | 9/12/2026 |
Initial capability package extracted from Eigenverft.WebLib.Infrastructure.
- ASP.NET Core HSTS helpers with configuration binding and optional code overrides over the native HSTS middleware.
- Public namespaces and behavior remain compatible with the original Infrastructure implementation.