Commit 260bbe54 authored by Jason R. Coombs's avatar Jason R. Coombs

Ensure a specified port in package_index isn't lost in the parse/unparse of...

Ensure a specified port in package_index isn't lost in the parse/unparse of the URL when auth is present. Fixes #1663.
parent 5133d86c
...@@ -1072,7 +1072,7 @@ def open_with_auth(url, opener=urllib.request.urlopen): ...@@ -1072,7 +1072,7 @@ def open_with_auth(url, opener=urllib.request.urlopen):
if auth: if auth:
auth = "Basic " + _encode_auth(auth) auth = "Basic " + _encode_auth(auth)
parts = scheme, parsed.hostname, path, params, query, frag parts = scheme, netloc, path, params, query, frag
new_url = urllib.parse.urlunparse(parts) new_url = urllib.parse.urlunparse(parts)
request = urllib.request.Request(new_url) request = urllib.request.Request(new_url)
request.add_header("Authorization", auth) request.add_header("Authorization", auth)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment