mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28:16 -06:00
14008 add webhook_headers to configuration.py
This commit is contained in:
parent
2f211034a9
commit
1f439a4464
@ -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):
|
||||
"""
|
||||
|
Loading…
Reference in New Issue
Block a user