diff options
author | Robert Brewer <fumanchu@aminus.org> | 2006-09-26 06:30:07 +0000 |
---|---|---|
committer | Robert Brewer <fumanchu@aminus.org> | 2006-09-26 06:30:07 +0000 |
commit | 9eeb076ecd0536386014d07b0de39670364a0ce2 (patch) | |
tree | e0f450725fe4ee8d772f1c3590a24633b3a83992 | |
parent | e2dd54b205e26a5d98d0a991553c5922eb286502 (diff) | |
download | cherrypy-git-9eeb076ecd0536386014d07b0de39670364a0ce2.tar.gz |
Some side issues from #573.
-rw-r--r-- | cherrypy/_cpwsgiserver.py | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/cherrypy/_cpwsgiserver.py b/cherrypy/_cpwsgiserver.py index 2deadaa6..79f63767 100644 --- a/cherrypy/_cpwsgiserver.py +++ b/cherrypy/_cpwsgiserver.py @@ -101,23 +101,23 @@ class HTTPRequest(object): atoms = [unquote(x) for x in quoted_slash.split(path)] path = "%2F".join(atoms) - for mount_point, wsgi_app in server.mount_points: - if path == "*": - # This means, of course, that the first wsgi_app will - # always handle a URI of "*". - self.environ["SCRIPT_NAME"] = "" - self.environ["PATH_INFO"] = "*" - self.wsgi_app = wsgi_app - break - # The mount_points list should be sorted by length, descending. - if path.startswith(mount_point): - self.environ["SCRIPT_NAME"] = mount_point - self.environ["PATH_INFO"] = path[len(mount_point):] - self.wsgi_app = wsgi_app - break + if path == "*": + # This means, of course, that the last wsgi_app (shortest path) + # will always handle a URI of "*". + self.environ["SCRIPT_NAME"] = "" + self.environ["PATH_INFO"] = "*" + self.wsgi_app = server.mount_points[-1][1] else: - self.simple_response("404 Not Found") - return + for mount_point, wsgi_app in server.mount_points: + # The mount_points list should be sorted by length, descending. + if path.startswith(mount_point): + self.environ["SCRIPT_NAME"] = mount_point + self.environ["PATH_INFO"] = path[len(mount_point):] + self.wsgi_app = wsgi_app + break + else: + self.simple_response("404 Not Found") + return # Note that, like wsgiref and most other WSGI servers, # we unquote the path but not the query string. |