# HG changeset patch # User Florent # Date 1243283165 -7200 # Node ID c5af2fbda5b63285b2518c39c7276817c0818db4 # Parent a54a3b665361f4c378d9e36a14ddf7da2d2eb592 pass request to ApacheRewriter rewrite method diff -r a54a3b665361 -r c5af2fbda5b6 etwist/server.py --- a/etwist/server.py Mon May 25 22:21:13 2009 +0200 +++ b/etwist/server.py Mon May 25 22:26:05 2009 +0200 @@ -196,7 +196,7 @@ if self.url_rewriter is not None: # XXX should occur before authentication? try: - path = self.url_rewriter.rewrite(host, origpath) + path = self.url_rewriter.rewrite(host, origpath, req) except Redirect, ex: return self.redirect(req, ex.location) request.uri.replace(origpath, path, 1) diff -r a54a3b665361 -r c5af2fbda5b6 web/views/apacherewrite.py --- a/web/views/apacherewrite.py Mon May 25 22:21:13 2009 +0200 +++ b/web/views/apacherewrite.py Mon May 25 22:26:05 2009 +0200 @@ -87,7 +87,8 @@ id = 'urlrewriter' rules = [] - def rewrite(self, host, path): + def rewrite(self, host, path, req): + self.req = req for cond in self.rules: if cond.match(host=host, path=path): return cond.process(path)