diff options
| author | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-11 10:12:14 +0000 |
|---|---|---|
| committer | Emmanuel Raviart <eraviart@entrouvert.com> | 2004-08-11 10:12:14 +0000 |
| commit | b2a263b48544d235f3704599fed074b5b24f4e41 (patch) | |
| tree | 20630d57d78be3db5aba5ea8b047ac121512b301 /python | |
| parent | 80a5b0009a69fd1e4d0451278dbbc5808563dc42 (diff) | |
| download | lasso-b2a263b48544d235f3704599fed074b5b24f4e41.tar.gz lasso-b2a263b48544d235f3704599fed074b5b24f4e41.tar.xz lasso-b2a263b48544d235f3704599fed074b5b24f4e41.zip | |
In Python simulator, redirect now accepts partial URLs.
Diffstat (limited to 'python')
| -rw-r--r-- | python/tests/websimulator.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/python/tests/websimulator.py b/python/tests/websimulator.py index cd75195d..1a07e8b5 100644 --- a/python/tests/websimulator.py +++ b/python/tests/websimulator.py @@ -103,6 +103,18 @@ class HttpRequestHandler(abstractweb.HttpRequestHandlerMixin, object): return session def respondRedirectTemporarily(self, url): + scheme = url.split('://')[0].lower() + if scheme not in ('http', 'https'): + # The url doesn't include host name => add it. + path = url + url = self.site.url + if path: + if path[0] == '/': + while url[-1] == '/': + url = url[:-1] + elif url[-1] != '/': + url += '/' + url += path return self.httpRequest.client.redirect(url) |
