Exemple #1
0
        /// <summary>
        /// This method is used to for security headers middleware .
        /// <param name="app"></param>
        /// <param name="builder"></param>
        /// </summary>
        /// <returns></returns>
        public static IApplicationBuilder UseSecurityHeadersMiddleware(this IApplicationBuilder app, SecurityHeadersBuilder builder)
        {
            SecurityHeadersPolicy policy = builder.Build();

            return(app.UseMiddleware <SecurityHeadersMiddleware>(policy));
        }
Exemple #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="next"></param>
 /// <param name="policy"></param>
 public SecurityHeadersMiddleware(RequestDelegate next, SecurityHeadersPolicy policy)
 {
     _next   = next;
     _policy = policy;
 }