ref: 0baf61881771961c5394908953aae4f24b8a7f92
parent: a5f176b6340d6e46dd135a0adbde60f5aa830565
author: aiju <aiju@phicode.de>
date: Mon May 9 15:41:17 EDT 2011
fixed HTTP Basic auth
--- a/sys/lib/python/hgext/hgfactotum.py
+++ b/sys/lib/python/hgext/hgfactotum.py
@@ -17,9 +17,8 @@
chal = urllib2.parse_keqv_list(urllib2.parse_http_list(authreq[1]))
realm = chal['realm']
self.f.start(proto="pass", host=host, realm=realm, role="client")
- pw = self.f.read()
- user = self.f.attr()["user"]
- val = 'Basic %s' % base64.b64encode(user + ':' + pw).strip()
+ pw = self.f.read().replace(' ', ':', 1)+ val = 'Basic %s' % base64.b64encode(pw).strip()
if req.headers.get('Authorization', None) == val: return None req.add_header('Authorization', val)return self.parent.open(req)
--
⑨