Skip to content

Commit

Permalink
patch around psf/requests#5297 by prefixing http:// for proxies
Browse files Browse the repository at this point in the history
  • Loading branch information
dsschult committed Jan 15, 2020
1 parent d167d79 commit 9aad209
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions iceprod/core/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,10 @@ async def download(url, local, options={}):
try:
if url.startswith('http'):
logging.info('http from %s to %s', url, local)
# http_proxy fix
for k in os.environ:
if k.lower() == 'http_proxy' and not os.environ[k].startswith('http'):
os.environ[k] = 'http://'+os.environ[k]
def _d():
with _http_helper(options) as s:
r = s.get(url, stream=True, timeout=300)
Expand Down

0 comments on commit 9aad209

Please sign in to comment.