Mercurial > public > mercurial-scm > hg-stable
diff mercurial/util.py @ 15024:0f1311e829c9 stable
http: strip credentials from urllib2 manager URIs (issue2885)
urllib2 password manager does not strip credentials from URIs registered with
add_password() and compare them with stripped URIs in find_password(). Remove
credentials from URIs returned by util.url.authinfo(). It sometimes works when
no port was specified as the URI host is registered too.
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Fri, 05 Aug 2011 21:05:40 +0200 |
parents | e89f62dcd723 |
children | 1e45b92f4fb2 24a6c3f903bb |
line wrap: on
line diff
--- a/mercurial/util.py Thu Aug 04 19:41:23 2011 +0300 +++ b/mercurial/util.py Fri Aug 05 21:05:40 2011 +0200 @@ -1565,7 +1565,9 @@ self.user, self.passwd = user, passwd if not self.user: return (s, None) - return (s, (None, (str(self), self.host), + # authinfo[1] is passed to urllib2 password manager, and its URIs + # must not contain credentials. + return (s, (None, (s, self.host), self.user, self.passwd or '')) def isabs(self):