Skip to content

Commit

Permalink
fix(api): exception when calling webhook (#516)
Browse files Browse the repository at this point in the history
  • Loading branch information
pycook committed May 20, 2024
1 parent dde7ec6 commit 5b275af
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmdb-api/api/lib/webhook.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ def webhook_request(webhook, payload):

params = webhook.get('parameters') or None
if isinstance(params, dict):
params = json.loads(Template(json.dumps(params)).render(payload))
params = json.loads(Template(json.dumps(params)).render(payload).encode('utf-8'))

headers = json.loads(Template(json.dumps(webhook.get('headers') or {})).render(payload))

data = Template(json.dumps(webhook.get('body', ''))).render(payload)
data = Template(json.dumps(webhook.get('body', ''))).render(payload).encode('utf-8')
auth = _wrap_auth(**webhook.get('authorization', {}))

if (webhook.get('authorization', {}).get("type") or '').lower() == 'oauth2.0':
Expand Down

0 comments on commit 5b275af

Please sign in to comment.