mirror of
https://github.com/markjprice/cs11dotnet7.git
synced 2025-12-06 05:32:03 +01:00
21 lines
425 B
C#
21 lines
425 B
C#
using Microsoft.Extensions.Primitives; // StringValues
|
|
|
|
public class SecurityHeaders
|
|
{
|
|
private readonly RequestDelegate next;
|
|
|
|
public SecurityHeaders(RequestDelegate next)
|
|
{
|
|
this.next = next;
|
|
}
|
|
|
|
public Task Invoke(HttpContext context)
|
|
{
|
|
// add any HTTP response headers you want here
|
|
context.Response.Headers.Add(
|
|
"super-secure", new StringValues("enable"));
|
|
|
|
return next(context);
|
|
}
|
|
}
|