Skip to content

Commit

Permalink
remove http proxy option
Browse files Browse the repository at this point in the history
  • Loading branch information
unknownuser88 committed Jul 18, 2017
1 parent 8825ae4 commit 42e32e4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions request.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,12 @@ def api_request_native(url, data=None, token=None, https_proxy=None, method=None

# print('API request data:', request.get_data())
# print('API request header:', request.header_items())
https_proxy = https_proxy if https_proxy != None else settings.get('https_proxy')
if https_proxy:
opener = urllib.build_opener(urllib.HTTPHandler(), urllib.HTTPSHandler(),
urllib.ProxyHandler({'https': https_proxy}))
# https_proxy = https_proxy if https_proxy != None else settings.get('https_proxy')
# if https_proxy:
# opener = urllib.build_opener(urllib.HTTPHandler(), urllib.HTTPSHandler(),
# urllib.ProxyHandler({'https': https_proxy}))

urllib.install_opener(opener)
# urllib.install_opener(opener)

try:
with contextlib.closing(urllib.urlopen(request)) as response:
Expand Down Expand Up @@ -92,9 +92,9 @@ def api_request_curl(url, data=None, token=None, https_proxy=None, method=None):
if method:
config.append('--request "%s"' % method)

https_proxy = https_proxy if https_proxy != None else settings.get('https_proxy')
if https_proxy:
config.append(https_proxy)
# https_proxy = https_proxy if https_proxy != None else settings.get('https_proxy')
# if https_proxy:
# config.append(https_proxy)

with named_tempfile() as header_output_file:
config.append('--dump-header "%s"' % header_output_file.name)
Expand Down

0 comments on commit 42e32e4

Please sign in to comment.