Anonymous avatar Anonymous committed c63bb45

Fixed an issue with wrapping plain WSGI callables and removed some pre-remix code.

Comments (0)

Files changed (3)

             # Get the 'Host' header, so we can do HTTPRedirects properly.
             self.process_headers()
             
-            if self.app is None:
-                # Some interfaces (like WSGI) may have already set self.app.
-                # If not, look up the app for this path.
-                self.script_name = r = cherrypy.tree.script_name(self.path)
-                if r is None:
-                    raise cherrypy.NotFound()
-                self.app = cherrypy.tree.apps[r]
-            else:
-                self.script_name = self.wsgi_environ.get('SCRIPT_NAME', '')
+            self.script_name = self.wsgi_environ.get('SCRIPT_NAME', '')
             
             # path_info should be the path from the
             # app root (script_name) to the handler.
             app = Application(app, script_name, conf)
         # Handle WSGI callables
         elif callable(app) and wrap:
-            app = HostedWSGI(app)
+            app = Application(HostedWSGI(app), script_name, conf)
         # In all other cases leave the app intact (no wrapping)
         
         self.apps[script_name] = app
         self._cp_config = {'tools.wsgiapp.on': True,
                            'tools.wsgiapp.app': app,
                           }
-    
-    def __call__(self, environ, start_response):
-        return self.app(environ, start_response)
+
 
 #                            Server components                            #
 
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.