mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
- 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:
parent
2e24044f9d
commit
afc4f0413a
1 changed files with 3 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue