mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
replace netloc by hostname when adding trusted-host arg to pip
This commit is contained in:
committed by
Dan Ryan
parent
a94018f837
commit
e8253feda4
+2
-2
@@ -439,7 +439,7 @@ def prepare_pip_source_args(sources, pip_args=None):
|
||||
|
||||
# Trust the host if it's not verified.
|
||||
if not sources[0].get('verify_ssl', True):
|
||||
pip_args.extend(['--trusted-host', urlparse(sources[0]['url']).netloc.split(':')[0]])
|
||||
pip_args.extend(['--trusted-host', urlparse(sources[0]['url']).hostname])
|
||||
|
||||
# Add additional sources as extra indexes.
|
||||
if len(sources) > 1:
|
||||
@@ -448,7 +448,7 @@ def prepare_pip_source_args(sources, pip_args=None):
|
||||
|
||||
# Trust the host if it's not verified.
|
||||
if not source.get('verify_ssl', True):
|
||||
pip_args.extend(['--trusted-host', urlparse(source['url']).netloc.split(':')[0]])
|
||||
pip_args.extend(['--trusted-host', urlparse(source['url']).hostname])
|
||||
|
||||
return pip_args
|
||||
|
||||
|
||||
Reference in New Issue
Block a user