-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application
Description
NetBox version
v2.10.8
Python version
3.9
Steps to Reproduce
- Create a webhook in Django admin (probably any will do)
- In the "Additional headers" enter: Header: 1:2
- Trigger the webhook
Expected Behavior
The webhook should be called with the configured headers
Observed Behavior
The webhook raises an exception and is not calling the configured URL:
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/rq/worker.py", line 1008, in perform_job
rv = job.perform()
File "/usr/local/lib/python3.9/site-packages/rq/job.py", line 706, in perform
self._result = self._execute()
File "/usr/local/lib/python3.9/site-packages/rq/job.py", line 729, in _execute
result = self.func(*self.args, **self.kwargs)
File "/opt/netbox/netbox/extras/webhooks_worker.py", line 36, in process_webhook
raise e
File "/opt/netbox/netbox/extras/webhooks_worker.py", line 33, in process_webhook
headers.update(webhook.render_headers(context))
File "/opt/netbox/netbox/extras/models/models.py", line 143, in render_headers
header, value = line.split(':')
ValueError: too many values to unpack (expected 2)
I've forked the current develop branch and have a fix in place locally, including a working test case. I can submit a pull request if you like.
sdktr
Metadata
Metadata
Assignees
Labels
status: acceptedThis issue has been accepted for implementationThis issue has been accepted for implementationtype: bugA confirmed report of unexpected behavior in the applicationA confirmed report of unexpected behavior in the application