From 83b5a4a4a00b7a816a1d7d02a285ad9e3c0becd0 Mon Sep 17 00:00:00 2001 From: Siopy Date: Thu, 21 Mar 2024 16:54:28 +0100 Subject: [PATCH] Split HTTP/HTTPS and fix timeout --- exegol/utils/WebUtils.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/exegol/utils/WebUtils.py b/exegol/utils/WebUtils.py index 8ad58987..593a8c1c 100644 --- a/exegol/utils/WebUtils.py +++ b/exegol/utils/WebUtils.py @@ -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: