Skip to content

Commit

Permalink
Split HTTP/HTTPS and fix timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
Siopy committed Mar 21, 2024
1 parent 4b54020 commit 83b5a4a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions exegol/utils/WebUtils.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,9 @@ def __runRequest(cls, url: str, service_name: str, headers: Optional[Dict] = Non
for i in range(retry_count):
try:
try:
proxy = os.environ.get('HTTP_PROXY') or os.environ.get('HTTPS_PROXY')
response = requests.request(method=method, url=url, timeout=(5, 10), verify=ParametersManager().verify, headers=headers, data=data, proxies={'http': proxy, 'https': proxy} if proxy else None)
http_proxy = os.environ.get('HTTP_PROXY') or os.environ.get('http_proxy')
https_proxy = os.environ.get('HTTPS_PROXY') or os.environ.get('https_proxy')
response = requests.request(method=method, url=url, timeout=(10, 20), verify=ParametersManager().verify, headers=headers, data=data, proxies={'http': http_proxy, 'https': https_proxy} if http_proxy or https_proxy else None)
return response
except requests.exceptions.HTTPError as e:
if e.response is not None:
Expand Down

0 comments on commit 83b5a4a

Please sign in to comment.