wsgi server bug in mount-point resolution with multiple mounted applications
Subversion revision 1374
In _cpwsgiserver.py, class HTTPRequest, method parse_request, the loop which sets self.wsgi_app, etc. will not always choose the correct application. Depth-first searching is necessary, but not sufficient, for this task.
Consider two applications, one mounted at "/", and one mounted at "/foo".
The resource "/foobar" is currently mapped as belonging to the "/foo" application. Worse, when the application receives the path, there is no distinction between "/foo/bar" and "/foobar" because the slash is stripped.
On a related note, I am not sure what the first test in this loop is for (path == "*"), but:
a) The test does not need to be inside the loop (could be before the loop); and b) Choosing the application with the longest path probably violates the principle of least surprise here.
Regards, Pat Maupin
Reported by email@example.com