Source

CherryPy / _cpwsgiserver.py

The branch 'cp3-wsgi-remix' does not exist.
Diff from to

_cpwsgiserver.py

         atoms = [unquote(x) for x in quoted_slash.split(path)]
         path = "%2F".join(atoms)
         
-        for mount_point, wsgi_app in self.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
-        else:
-            self.abort("404 Not Found")
-            return
+        self.wsgi_app = self.server.app
+        self.environ['SCRIPT_NAME'] = ''
+        self.environ['PATH_INFO'] = path
         
         # Note that, like wsgiref and most other WSGI servers,
         # we unquote the path but not the query string.
                  max=-1, request_queue_size=5, timeout=10):
         self.requests = Queue.Queue(max)
         
-        if callable(wsgi_app):
-            # We've been handed a single wsgi_app, in CP-2.1 style.
-            # Assume it's mounted at "".
-            self.mount_points = [("", wsgi_app)]
-        else:
-            # We've been handed a list of (mount_point, wsgi_app) tuples,
-            # so that the server can call different wsgi_apps, and also
-            # correctly set SCRIPT_NAME.
-            self.mount_points = wsgi_app
-        self.mount_points.sort()
-        self.mount_points.reverse()
+        self.app = wsgi_app
         
         self.bind_addr = bind_addr
         self.numthreads = numthreads or 1
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.