mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fix 4549 webhook body encode in utf-8
This commit is contained in:
@ -11,6 +11,7 @@
|
|||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* [#4527](https://github.com/netbox-community/netbox/issues/4527) - Fix assignment of certain tags to config contexts
|
* [#4527](https://github.com/netbox-community/netbox/issues/4527) - Fix assignment of certain tags to config contexts
|
||||||
|
* [#4549](https://github.com/netbox-community/netbox/issues/4549) - Fix encoding unicode webhook body data
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
|
@ -17,7 +17,7 @@ def generate_signature(request_body, secret):
|
|||||||
"""
|
"""
|
||||||
hmac_prep = hmac.new(
|
hmac_prep = hmac.new(
|
||||||
key=secret.encode('utf8'),
|
key=secret.encode('utf8'),
|
||||||
msg=request_body.encode('utf8'),
|
msg=request_body,
|
||||||
digestmod=hashlib.sha512
|
digestmod=hashlib.sha512
|
||||||
)
|
)
|
||||||
return hmac_prep.hexdigest()
|
return hmac_prep.hexdigest()
|
||||||
|
@ -46,7 +46,7 @@ def process_webhook(webhook, data, model_name, event, timestamp, username, reque
|
|||||||
'method': webhook.http_method,
|
'method': webhook.http_method,
|
||||||
'url': webhook.payload_url,
|
'url': webhook.payload_url,
|
||||||
'headers': headers,
|
'headers': headers,
|
||||||
'data': body,
|
'data': body.encode('utf8'),
|
||||||
}
|
}
|
||||||
logger.info(
|
logger.info(
|
||||||
"Sending {} request to {} ({} {})".format(
|
"Sending {} request to {} ({} {})".format(
|
||||||
|
Reference in New Issue
Block a user