Eigenverft.WebLib.Hsts 1.0.0.5-g40a2f17cdc

This is a prerelease version of Eigenverft.WebLib.Hsts.
dotnet add package Eigenverft.WebLib.Hsts --version 1.0.0.5-g40a2f17cdc
                    
NuGet\Install-Package Eigenverft.WebLib.Hsts -Version 1.0.0.5-g40a2f17cdc
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Eigenverft.WebLib.Hsts" Version="1.0.0.5-g40a2f17cdc" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Eigenverft.WebLib.Hsts" Version="1.0.0.5-g40a2f17cdc" />
                    
Directory.Packages.props
<PackageReference Include="Eigenverft.WebLib.Hsts" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Eigenverft.WebLib.Hsts --version 1.0.0.5-g40a2f17cdc
                    
#r "nuget: Eigenverft.WebLib.Hsts, 1.0.0.5-g40a2f17cdc"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Eigenverft.WebLib.Hsts@1.0.0.5-g40a2f17cdc
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Eigenverft.WebLib.Hsts&version=1.0.0.5-g40a2f17cdc&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Eigenverft.WebLib.Hsts&version=1.0.0.5-g40a2f17cdc&prerelease
                    
Install as a Cake Tool

Eigenverft.WebLib.Hsts

NuGet Version NuGet Downloads Repository CI Targets License

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.

๐Ÿ“„ License

Licensed under the MIT License by Eigenverft.

Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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.