summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérôme Schneider <jschneider@entrouvert.com>2015-07-23 09:17:29 (GMT)
committerJérôme Schneider <jschneider@entrouvert.com>2015-07-23 09:17:29 (GMT)
commit6ae398d9421f4f1849dab7541dce374414647cb8 (patch)
treefb2c2f63c4ab5fb7b892bce49ebd2798f6601f7e
parent72b7292e57385ca731d7a08bf94824b07ef72c58 (diff)
downloadmandaye-6ae398d9421f4f1849dab7541dce374414647cb8.zip
mandaye-6ae398d9421f4f1849dab7541dce374414647cb8.tar.gz
mandaye-6ae398d9421f4f1849dab7541dce374414647cb8.tar.bz2
authform.py: correctly resolve relative path in form action
-rw-r--r--mandaye/auth/authform.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/mandaye/auth/authform.py b/mandaye/auth/authform.py
index 98df943..f9c23e9 100644
--- a/mandaye/auth/authform.py
+++ b/mandaye/auth/authform.py
@@ -201,7 +201,11 @@ a password_field key if you want to encode a password.")
action = auth_form.action
if not "://" in action:
- login_url = re.sub(r'\?.*$', '', self.login_url)
+ basename = os.path.basename(self.login_url)
+ if basename:
+ login_url = self.login_url.split(basename)[0]
+ else:
+ login_url = self.login_url
action = os.path.join(login_url, action)
cookies = login.cookies