merge from 3.2 - Fix Issue #13642: Unquote before b64encoding user:password during Basic Authentication.

This commit is contained in:
Senthil Kumaran 2012-01-14 19:12:28 +08:00
commit 4479577388
3 changed files with 36 additions and 2 deletions

View file

@ -1693,11 +1693,13 @@ class URLopener:
if not host: raise IOError('http error', 'no host given')
if proxy_passwd:
proxy_passwd = unquote(proxy_passwd)
proxy_auth = base64.b64encode(proxy_passwd.encode()).decode('ascii')
else:
proxy_auth = None
if user_passwd:
user_passwd = unquote(user_passwd)
auth = base64.b64encode(user_passwd.encode()).decode('ascii')
else:
auth = None