mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2024-11-22 10:23:50 +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)
|
debugPrint(args.debug, "url:%s" % url)
|
||||||
try:
|
try:
|
||||||
req = urllib2.Request(url)
|
req = urllib2.Request(url)
|
||||||
|
req.add_header("User-Agent", "check_http_json")
|
||||||
if args.auth:
|
if args.auth:
|
||||||
base64str = base64.encodestring(args.auth).replace('\n', '')
|
base64str = base64.encodestring(args.auth).replace('\n', '')
|
||||||
req.add_header('Authorization', 'Basic %s' % base64str)
|
req.add_header('Authorization', 'Basic %s' % base64str)
|
||||||
|
Loading…
Reference in New Issue
Block a user