mirror of
https://github.com/drewkerrigan/nagios-http-json.git
synced 2026-02-11 09:30:58 +01:00
Added default User-Agent header
This commit is contained in:
@@ -407,6 +407,7 @@ if __name__ == "__main__":
|
|||||||
# Attempt to reach the endpoint
|
# Attempt to reach the endpoint
|
||||||
try:
|
try:
|
||||||
req = urllib2.Request(url)
|
req = urllib2.Request(url)
|
||||||
|
req.add_header("User-Agent", "nagios-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)
|
||||||
|
|||||||
Reference in New Issue
Block a user