public static IApplicationBuilder UseContentSecurityPolicy(this IApplicationBuilder app, Action <ContentSecurityPolicyOptionsBuilder> builder) { ContentSecurityPolicyOptionsBuilder newBuilder = new ContentSecurityPolicyOptionsBuilder(); builder(newBuilder); ContentSecurityPolicyOptions options = newBuilder.Build(); return(app.UseMiddleware <ContentSecurityPolicyMiddleware>(options)); }
public ContentSecurityPolicyMiddleware(RequestDelegate next, ContentSecurityPolicyOptions options) { this.next = next; this.options = options; }