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);
		}
Example #2
0
		public void ProcessRequest (Responder responder)
		{
			var worker = new WorkerRequest (responder,
				this);
			
			string path = responder.Path;
			if (!String.IsNullOrEmpty(path) && path [path.Length - 1] != '/' 
				&& VirtualDirectoryExists (path, worker)) {
				Redirect (worker, path + '/');
				return;
			}
			
			ProcessRequest (worker);
		}
Example #3
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));
        }
Example #4
0
        public void ProcessRequest(Responder responder)
        {
            var worker = new WorkerRequest(responder,
                                           this);

            string path = responder.Path;

            if (!String.IsNullOrEmpty(path) && path [path.Length - 1] != '/' &&
                VirtualDirectoryExists(path, worker))
            {
                Redirect(worker, path + '/');
                return;
            }

            ProcessRequest(worker);
        }
        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);
        }
Example #6
0
        public void ProcessRequest(Responder responder)
        {
            WorkerRequest worker = new WorkerRequest(responder,
                                                     this);

            string path = responder.Path;
            int    len  = path != null ? path.Length : 0;

            if (len > 0 && path [len - 1] != '/' && VirtualDirectoryExists(path, worker))
            {
                Redirect(worker, path + '/');
                return;
            }

            ProcessRequest(worker);
        }
Example #7
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);
        }
Example #8
0
        public void ProcessRequest(Responder responder)
        {
            WorkerRequest worker = new WorkerRequest (responder,
                this);

            string path = responder.Path;
            int len = path != null ? path.Length : 0;
            if (len > 0 && path [len - 1] != '/' && VirtualDirectoryExists (path, worker)) {
                Redirect (worker, path + '/');
                return;
            }

            ProcessRequest (worker);
        }