Skip to content
Snippets Groups Projects
Commit 2dfe6aad authored by Stéphane Diemer's avatar Stéphane Diemer
Browse files

Ignore proxies in Nginx tests.

parent cb649ea8
No related branches found
No related tags found
No related merge requests found
...@@ -13,7 +13,7 @@ if not os.path.exists('/etc/nginx'): ...@@ -13,7 +13,7 @@ if not os.path.exists('/etc/nginx'):
else: else:
print('Checking http://127.0.0.1:1080/nginx_status response.') print('Checking http://127.0.0.1:1080/nginx_status response.')
try: try:
req = requests.get('http://127.0.0.1:1080/nginx_status', timeout=5) req = requests.get('http://127.0.0.1:1080/nginx_status', proxies={'http': '', 'https': ''}, timeout=5)
if req.status_code != 200: if req.status_code != 200:
raise Exception('Request failed with status code %s.' % req.status_code) raise Exception('Request failed with status code %s.' % req.status_code)
if 'Active connections' not in req.text: if 'Active connections' not in req.text:
......
...@@ -37,7 +37,7 @@ else: ...@@ -37,7 +37,7 @@ else:
url = '%s://%s' % ('https' if https else 'http', domain) url = '%s://%s' % ('https' if https else 'http', domain)
sys.stdout.write('Testing url "%s": ' % url) sys.stdout.write('Testing url "%s": ' % url)
try: try:
req = requests.get(url, verify=False, timeout=10) req = requests.get(url, verify=False, proxies={'http': '', 'https': ''}, timeout=10)
except Exception as e: except Exception as e:
code = str(e) code = str(e)
else: else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment