Add http_proxy and https_proxy setting, remove fix_broken_https_proxy setting.

This commit is contained in:
Jim Miller 2021-07-12 09:18:02 -05:00
parent 7a30473ce2
commit ab6c023903
2 changed files with 6 additions and 10 deletions

View file

@ -194,7 +194,6 @@ def get_valid_set_options():
'titlepage_use_table':(None,None,boollist),
'use_ssl_unverified_context':(None,None,boollist),
'fix_broken_https_proxy':(None,None,boollist),
'use_cloudscraper':(None,None,boollist),
'use_basic_cache':(None,None,boollist),
'use_nsapa_proxy':(None,None,boollist),
@ -481,7 +480,8 @@ def get_valid_keywords():
'tweak_fg_sleep',
'universe_as_series',
'use_ssl_unverified_context',
'fix_broken_https_proxy',
'http_proxy',
'https_proxy',
'use_cloudscraper',
'use_basic_cache',
'use_browser_cache',

View file

@ -433,14 +433,10 @@ class RequestsFetcher(Fetcher):
logger.error("Failed during proxy collect/set %s"%e)
except:
pass
if 'https://' in session.proxies.get('https','') and self.getConfig('fix_broken_https_proxy',False):
## Starting sometime in urllib3=1.26.X, urllib3/python
## started actually honoring the https in a proxy setting.
## The problem is that windows has historically put the
## https in for https the proxy setting even though it
## *wasn't* over https.
##
session.proxies['https'] = session.proxies['https'].replace('https://','http://')
if self.getConfig('http_proxy'):
session.proxies['http'] = self.getConfig('http_proxy')
if self.getConfig('https_proxy'):
session.proxies['https'] = self.getConfig('https_proxy')
logger.debug("Session Proxies After:%s"%session.proxies)
def get_requests_session(self):