- Make sure to quote the username and password (SF patch #103236 by

dogfort).

- Don't drop the data argument when calling open_https() from the
  authentication error handler.
This commit is contained in:
Guido van Rossum 2001-01-15 18:31:13 +00:00
parent 2e24044f9d
commit afc4f0413a

View file

@ -563,7 +563,7 @@ class FancyURLopener(URLopener):
host = host[i:]
user, passwd = self.get_user_passwd(host, realm, i)
if not (user or passwd): return None
host = user + ':' + passwd + '@' + host
host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host
newurl = 'http://' + host + selector
if data is None:
return self.open(newurl)
@ -576,9 +576,9 @@ class FancyURLopener(URLopener):
host = host[i:]
user, passwd = self.get_user_passwd(host, realm, i)
if not (user or passwd): return None
host = user + ':' + passwd + '@' + host
host = quote(user, safe='') + ':' + quote(passwd, safe='') + '@' + host
newurl = '//' + host + selector
return self.open_https(newurl)
return self.open_https(newurl, data)
def get_user_passwd(self, host, realm, clear_cache = 0):
key = realm + '@' + host.lower()