mirror of
https://github.com/YunoHost/webhooks.git
synced 2024-09-03 19:56:54 +02:00
[fix] expected byte, not str
This commit is contained in:
parent
1b522269bb
commit
1c65204847
1 changed files with 1 additions and 1 deletions
|
@ -39,7 +39,7 @@ async def github(request):
|
|||
abort(501)
|
||||
|
||||
# HMAC requires the key to be bytes, but data is string
|
||||
mac = hmac.new(str(secret), msg=request.body, digestmod=hashlib.sha1)
|
||||
mac = hmac.new(secret.encode(), msg=request.body, digestmod=hashlib.sha1)
|
||||
|
||||
if not hmac.compare_digest(str(mac.hexdigest()), str(signature)):
|
||||
abort(403)
|
||||
|
|
Loading…
Reference in a new issue