##// END OF EJS Templates
url: more bytes/unicodes fussing in url.py around auth handling...
Augie Fackler -
r36670:8381126b default
parent child Browse files
Show More
@@ -143,6 +143,7 b' test-histedit-obsolete.t'
143 test-histedit-outgoing.t
143 test-histedit-outgoing.t
144 test-histedit-templates.t
144 test-histedit-templates.t
145 test-http-branchmap.t
145 test-http-branchmap.t
146 test-http-bundle1.t
146 test-http-clone-r.t
147 test-http-clone-r.t
147 test-identify.t
148 test-identify.t
148 test-imports-checker.t
149 test-imports-checker.t
@@ -67,7 +67,7 b' class passwordmgr(object):'
67 user, passwd = auth.get('username'), auth.get('password')
67 user, passwd = auth.get('username'), auth.get('password')
68 self.ui.debug("using auth.%s.* for authentication\n" % group)
68 self.ui.debug("using auth.%s.* for authentication\n" % group)
69 if not user or not passwd:
69 if not user or not passwd:
70 u = util.url(authuri)
70 u = util.url(pycompat.bytesurl(authuri))
71 u.query = None
71 u.query = None
72 if not self.ui.interactive():
72 if not self.ui.interactive():
73 raise error.Abort(_('http authorization required for %s') %
73 raise error.Abort(_('http authorization required for %s') %
@@ -75,7 +75,7 b' class passwordmgr(object):'
75
75
76 self.ui.write(_("http authorization required for %s\n") %
76 self.ui.write(_("http authorization required for %s\n") %
77 util.hidepassword(bytes(u)))
77 util.hidepassword(bytes(u)))
78 self.ui.write(_("realm: %s\n") % realm)
78 self.ui.write(_("realm: %s\n") % pycompat.bytesurl(realm))
79 if user:
79 if user:
80 self.ui.write(_("user: %s\n") % user)
80 self.ui.write(_("user: %s\n") % user)
81 else:
81 else:
@@ -424,8 +424,8 b' class httpbasicauthhandler(urlreq.httpba'
424 user, pw = self.passwd.find_user_password(
424 user, pw = self.passwd.find_user_password(
425 realm, urllibcompat.getfullurl(req))
425 realm, urllibcompat.getfullurl(req))
426 if pw is not None:
426 if pw is not None:
427 raw = "%s:%s" % (user, pw)
427 raw = "%s:%s" % (pycompat.bytesurl(user), pycompat.bytesurl(pw))
428 auth = 'Basic %s' % base64.b64encode(raw).strip()
428 auth = r'Basic %s' % pycompat.strurl(base64.b64encode(raw).strip())
429 if req.get_header(self.auth_header, None) == auth:
429 if req.get_header(self.auth_header, None) == auth:
430 return None
430 return None
431 self.auth = auth
431 self.auth = auth
General Comments 0
You need to be logged in to leave comments. Login now