Changeset 1791
- Timestamp:
- 10/27/07 23:21:19
- Files:
-
- trunk/cherrypy/_cpdispatch.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpdispatch.py
r1657 r1791 219 219 220 220 221 class WSGIEnvProxy(object):222 223 def __getattr__(self, key):224 return getattr(cherrypy.request.wsgi_environ, key)225 226 227 221 class RoutesDispatcher(object): 228 222 """A Routes based dispatcher for CherryPy.""" … … 265 259 config = routes.request_config() 266 260 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 270 263 config.host = request.headers.get('Host', None) 271 264 config.protocol = request.scheme

