mirror of
https://github.com/python/cpython.git
synced 2025-08-30 21:48:47 +00:00
part of #3613: fix get_host_info() usage of base64.encodestring().
This commit is contained in:
parent
35e2c4e67a
commit
c8dcfb6cec
2 changed files with 10 additions and 1 deletions
|
@ -1161,7 +1161,8 @@ class Transport:
|
|||
|
||||
if auth:
|
||||
import base64
|
||||
auth = base64.encodestring(urllib.parse.unquote(auth))
|
||||
auth = urllib.parse.unquote_to_bytes(auth)
|
||||
auth = base64.encodestring(auth).decode("utf-8")
|
||||
auth = "".join(auth.split()) # get rid of whitespace
|
||||
extra_headers = [
|
||||
("Authorization", "Basic " + auth)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue