From 1fda24c2f3bc1b48e8ae5b60afe45c1a41be804f Mon Sep 17 00:00:00 2001 From: Julien Cristau Date: Fri, 23 Feb 2018 16:21:06 +0100 Subject: [PATCH] mirror-health: set User-Agent http header --- modules/roles/files/mirror_health/mirror-health | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/roles/files/mirror_health/mirror-health b/modules/roles/files/mirror_health/mirror-health index 2c582f25a..bbd4c2787 100755 --- a/modules/roles/files/mirror_health/mirror-health +++ b/modules/roles/files/mirror_health/mirror-health @@ -21,7 +21,8 @@ def retrieve_from_host(host, url): 'http': 'http://{}:80'.format(host), 'https': 'http://{}:443'.format(host), } - return requests.get(url, timeout=5, proxies=proxies, allow_redirects=False) + headers = {'User-Agent': 'mirror-health'} + return requests.get(url, headers=headers, timeout=5, proxies=proxies, allow_redirects=False) def last_modified(response): lm = 0 -- 2.20.1