mirror of
https://github.com/python/cpython.git
synced 2025-10-21 22:22:48 +00:00
merge from 3.2 - Fix Issue #13642: Unquote before b64encoding user:password during Basic Authentication.
This commit is contained in:
commit
4479577388
3 changed files with 36 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue