diff options
| author | aiju <aiju@phicode.de> | 2011-05-09 19:41:17 +0000 |
|---|---|---|
| committer | aiju <aiju@phicode.de> | 2011-05-09 19:41:17 +0000 |
| commit | 4351887efd9dc8ab1eb334615262690a9751236c (patch) | |
| tree | 6d6eda6ab2fccd1b42905d4fca20929119d7b58b | |
| parent | 4f3376aede2c0f13f3bdf8584ab5e80d05ebaa78 (diff) | |
| download | plan9front-4351887efd9dc8ab1eb334615262690a9751236c.tar.xz | |
fixed HTTP Basic auth
| -rw-r--r-- | sys/lib/python/hgext/hgfactotum.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/sys/lib/python/hgext/hgfactotum.py b/sys/lib/python/hgext/hgfactotum.py index b850e1e78..654c7a7d3 100644 --- a/sys/lib/python/hgext/hgfactotum.py +++ b/sys/lib/python/hgext/hgfactotum.py @@ -17,9 +17,8 @@ class factotumbasic(urllib2.BaseHandler): 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) |
