public void ProcessRequest (Responder responder)
		{
			WorkerRequest worker = new WorkerRequest (responder,
				this);
			
			string path = responder.Path;
			if (path [path.Length - 1] != '/' && Directory.Exists (
				worker.MapPath (path))) {
				Redirect (worker, path + '/');
				return;
			}
			
			ProcessRequest (worker);
		}
示例#2
0
        private bool VirtualDirectoryExists(string virtualPath, WorkerRequest worker)
        {
            VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;

            // TODO: Remove the second condition of the "if" statement (it is only a workaround) involving DefaultVirtualPathProvider as soon as Mono's DefaultVirtualPathProvider.DirectoryExists method works properly (i.e., the indirectly-called HostingEnvironment.MapPath method should not require an HttpContext.Current.Request object to do its work; also see the comment in the ApplicationHost.MapPath method above)
            if (vpp != null && !vpp.GetType().FullName.Equals("System.Web.Hosting.DefaultVirtualPathProvider", StringComparison.Ordinal))
            {
                return(vpp.DirectoryExists(virtualPath));
            }

            string physicalPath = (worker != null) ? worker.MapPath(virtualPath) : MapPath(virtualPath);

            return(Directory.Exists(physicalPath));
        }
        public void ProcessRequest(Responder responder)
        {
            WorkerRequest worker = new WorkerRequest(responder,
                                                     this);

            string path = responder.Path;

            if (path [path.Length - 1] != '/' && Directory.Exists(
                    worker.MapPath(path)))
            {
                Redirect(worker, path + '/');
                return;
            }

            ProcessRequest(worker);
        }
示例#4
0
        bool VirtualDirectoryExists(string virtualPath, WorkerRequest worker)
        {
            VirtualPathProvider vpp = HostingEnvironment.VirtualPathProvider;
            // TODO: Remove the second condition of the "if" statement (it is only a workaround) involving DefaultVirtualPathProvider as soon as Mono's DefaultVirtualPathProvider.DirectoryExists method works properly (i.e., the indirectly-called HostingEnvironment.MapPath method should not require an HttpContext.Current.Request object to do its work; also see the comment in the ApplicationHost.MapPath method above)
            if (vpp != null && !vpp.GetType().FullName.Equals("System.Web.Hosting.DefaultVirtualPathProvider", StringComparison.Ordinal))
                return vpp.DirectoryExists (virtualPath);

            string physicalPath = (worker != null) ? worker.MapPath (virtualPath) : MapPath (virtualPath);
            return Directory.Exists (physicalPath);
        }