Download Install Tutorial Docs FAQ Tools WikiLicense Team IRC Planet Involvement Shop Book

Changeset 1791

Show
Ignore:
Timestamp:
10/27/07 23:21:19
Author:
fumanchu
Message:

Fix for #719 (RoutesDispatcher? not working correctly).

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/cherrypy/_cpdispatch.py

    r1657 r1791  
    219219 
    220220 
    221 class WSGIEnvProxy(object): 
    222      
    223     def __getattr__(self, key): 
    224         return getattr(cherrypy.request.wsgi_environ, key) 
    225  
    226  
    227221class RoutesDispatcher(object): 
    228222    """A Routes based dispatcher for CherryPy.""" 
     
    265259        config = routes.request_config() 
    266260        config.mapper = self.mapper 
    267         # Since Routes' mapper.environ is not threadsafe, 
    268         # we must use a proxy which does JIT lookup. 
    269         config.mapper.environ = WSGIEnvProxy() 
     261        if hasattr(cherrypy.request, 'wsgi_environ'): 
     262            config.environ = cherrypy.request.wsgi_environ 
    270263        config.host = request.headers.get('Host', None) 
    271264        config.protocol = request.scheme 

Hosted by WebFaction

Log in as guest/cpguest to create tickets