Commits

Anonymous committed c63bb45

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

  • Participants
  • Parent commits e7330b8
  • Branches cp3-wsgi-remix

Comments (0)

Files changed (3)

File _cprequest.py

             # 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                            #