Add optional headers parameter for webhooks in notify API command

This commit is contained in:
JonnyWong16 2019-11-11 15:41:11 -08:00
parent ddbd486500
commit cfc30c1234
4 changed files with 5 additions and 1 deletions

View file

@ -3613,6 +3613,7 @@ class WEBHOOK(Notifier):
}
def agent_notify(self, subject='', body='', action='', **kwargs):
subject = kwargs.get('headers', subject)
if subject:
try:
webhook_headers = json.loads(subject)
@ -3631,7 +3632,7 @@ class WEBHOOK(Notifier):
else:
webhook_body = None
headers = {'Content-type': 'application/json'}
headers = {'Content-Type': 'application/json'}
if webhook_headers:
headers.update(webhook_headers)