Commits

Robert Brewer committed 5869289

Fix for #719 (RoutesDispatcher not working correctly).

Comments (0)

Files changed (1)

cherrypy/_cpdispatch.py

             request.handler = cherrypy.NotFound()
 
 
-class WSGIEnvProxy(object):
-    
-    def __getattr__(self, key):
-        return getattr(cherrypy.request.wsgi_environ, key)
-
-
 class RoutesDispatcher(object):
     """A Routes based dispatcher for CherryPy."""
     
         
         config = routes.request_config()
         config.mapper = self.mapper
-        # Since Routes' mapper.environ is not threadsafe,
-        # we must use a proxy which does JIT lookup.
-        config.mapper.environ = WSGIEnvProxy()
+        if hasattr(cherrypy.request, 'wsgi_environ'):
+            config.environ = cherrypy.request.wsgi_environ
         config.host = request.headers.get('Host', None)
         config.protocol = request.scheme
         config.redirect = self.redirect