Mercurial > kallithea
diff rhodecode/lib/base.py @ 2490:7a5eeafb1a9a beta
better path extraction method.
fixed error document old html
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Wed, 20 Jun 2012 00:01:06 +0200 |
parents | 6f537e3da9c4 |
children | f0851f37d6be |
line wrap: on
line diff
--- a/rhodecode/lib/base.py Tue Jun 19 23:07:23 2012 +0200 +++ b/rhodecode/lib/base.py Wed Jun 20 00:01:06 2012 +0200 @@ -48,6 +48,14 @@ return ip +def _get_access_path(environ): + path = environ.get('PATH_INFO') + org_req = environ.get('pylons.original_request') + if org_req: + path = org_req.environ.get('PATH_INFO') + return path + + class BasicAuth(AuthBasicAuthenticator): def __init__(self, realm, authfunc, auth_http_code=None): @@ -187,13 +195,13 @@ cookie_store.get('is_authenticated') ) log.info('IP: %s User: %s accessed %s' % ( - self.ip_addr, auth_user, safe_unicode(environ.get('PATH_INFO'))) + self.ip_addr, auth_user, safe_unicode(_get_access_path(environ))) ) return WSGIController.__call__(self, environ, start_response) finally: log.info('IP: %s Request to %s time: %.3fs' % ( _get_ip_addr(environ), - safe_unicode(environ.get('PATH_INFO')), time.time() - start) + safe_unicode(_get_access_path(environ)), time.time() - start) ) meta.Session.remove()