From 7858382bbed7b83f77457faa36b4f5e3f0331b54 Mon Sep 17 00:00:00 2001 From: Ricardo Bartels Date: Thu, 9 May 2019 15:53:59 +0200 Subject: [PATCH] Added default User-Agent header * prevent errors for services which require this header (like Cloudflare WAF) --- check_http_json.py | 1 + 1 file changed, 1 insertion(+) diff --git a/check_http_json.py b/check_http_json.py index 33b2bd4..bc7b14f 100755 --- a/check_http_json.py +++ b/check_http_json.py @@ -731,6 +731,7 @@ if __name__ == "__main__": debugPrint(args.debug, "url:%s" % url) try: req = urllib2.Request(url) + req.add_header("User-Agent", "check_http_json") if args.auth: base64str = base64.encodestring(args.auth).replace('\n', '') req.add_header('Authorization', 'Basic %s' % base64str)