/// <summary> /// Adds a Expect-CT Header to the response. /// </summary> /// <param name="app">The <see cref="IApplicationBuilder"/></param> /// <param name="options"></param> /// <returns>The <see cref="IApplicationBuilder"/></returns> public static IApplicationBuilder UseExpectCT( this IApplicationBuilder app, ExpectCTOptions options) { return(app.UseMiddleware <ExpectCTMiddleware>(new OptionsWrapper <ExpectCTOptions>(options))); }
public ExpectCTMiddleware(RequestDelegate next, ExpectCTOptions options) { _next = next; Options = options ?? throw new ArgumentNullException(nameof(options)); _headerValue = Options.ToString(); }
public ExpectCTMiddleware(ExpectCTOptions options) { Options = options ?? throw new ArgumentNullException(nameof(options)); _headerValue = Options.ToString(); }
/// <summary> /// Adds the Expect-CT header which allows sites to opt in to reporting and/or enforcement of Certificate Transparency requirements. /// </summary> /// <param name="app"></param> /// <param name="options"></param> public static void UseExpectCT(this IApplicationBuilder app, ExpectCTOptions options) { app.UseMiddleware <ExpectCTMiddleware>(options); }
public static IServiceCollection AddExpectCT(this IServiceCollection services, ExpectCTOptions options) { services.AddSingleton <ExpectCTMiddleware>(); services.AddSingleton(options); return(services); }