mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2024-12-22 17:13:55 +01:00
Added default User-Agent header
* prevent errors for services which require this header (like Cloudflare WAF)
This commit is contained in:
parent
1173420803
commit
7858382bbe
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user