14008 add webhook_headers to configuration.py

This commit is contained in:
Arthur 2023-12-06 13:22:09 -08:00
parent 2f211034a9
commit 1f439a4464

View File

@ -284,16 +284,14 @@ class Webhook(CustomFieldsMixin, ExportTemplatesMixin, TagsMixin, ChangeLoggedMo
"""
Render additional_headers and return a dict of Header: Value pairs.
"""
headers = get_config().WEBHOOK_HEADERS.update(self.additional_headers)
if not headers:
return {}
ret = {}
data = render_jinja2(headers, context)
headers = get_config().WEBHOOK_HEADERS
if self.additional_headers:
data = render_jinja2(self.additional_headers, context)
for line in data.splitlines():
header, value = line.split(':', 1)
ret[header.strip()] = value.strip()
return ret
headers[header.strip()] = value.strip()
return headers
def render_body(self, context):
"""