public override Task Invoke(IOwinContext context) { Trace.WriteLine("Invoke IsPrivateFolderMiddleware"); var path = FileSystem.MapPath(_options.BasePath, context.Request.Path.Value); if (path.Contains(@"\.") || path.Contains(@"\_") || path.Contains(@"\ssl\")) { return(StatusHandler.Handle403(context, Next)); } return(Next.Invoke(context)); }