[testlib] __errorurl may be a relative path, check we're actually removing base url first stable
authorSylvain Thénault <sylvain.thenault@logilab.fr>
Fri, 26 Mar 2010 13:21:25 +0100
branchstable
changeset 5036 3e436a494ce3
parent 5035 8469d0acd949
child 5037 7778a2bbdf9d
[testlib] __errorurl may be a relative path, check we're actually removing base url first
devtools/testlib.py
--- a/devtools/testlib.py	Fri Mar 26 13:20:42 2010 +0100
+++ b/devtools/testlib.py	Fri Mar 26 13:21:25 2010 +0100
@@ -499,7 +499,8 @@
             else:
                 cleanup = lambda p: (p[0], unquote(p[1]))
                 params = dict(cleanup(p.split('=', 1)) for p in params.split('&') if p)
-            path = path[len(req.base_url()):]
+            if path.startswith(req.base_url()): # may be relative
+                path = path[len(req.base_url()):]
             return path, params
         else:
             self.fail('expected a Redirect exception')