private static IHttpHandler ReturnDefaultHandler(IHttpRequest httpReq)
{
var pathProvider = HostContext.VirtualFileSources;
var defaultDoc = pathProvider.GetFile(DefaultRootFileName ?? "");
if (httpReq.GetPhysicalPath() != WebHostPhysicalPath
|| defaultDoc == null)
{
return new IndexPageHttpHandler();
}
var okToServe = ShouldAllow(httpReq.GetPhysicalPath());
return okToServe ? DefaultHttpHandler : ForbiddenHttpHandler;
}