/// <summary>
 /// Will add <see cref="ProtectFolderMiddleware"/> to the pipeline. Must be used before .UseStaticFiles()!
 /// </summary>
 /// <param name="builder"></param>
 /// <param name="options"></param>
 /// <returns></returns>
 public static IApplicationBuilder UseProtectFolder(this IApplicationBuilder builder, ProtectFolderOptions options)
 {
     return(builder.UseMiddleware <ProtectFolderMiddleware>(options));
 }
Exemplo n.º 2
0
 public ProtectFolderMiddleware(RequestDelegate next, ProtectFolderOptions options)
 {
     _next       = next;
     _path       = options.Path;
     _policyName = options.PolicyName;
 }