From 1c652048471e02c9ba8f0b0c176cf98637d64dab Mon Sep 17 00:00:00 2001 From: Laurent Peuch Date: Tue, 5 Feb 2019 23:17:23 +0100 Subject: [PATCH] [fix] expected byte, not str --- server.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server.py b/server.py index ca7fee5..750d732 100644 --- a/server.py +++ b/server.py @@ -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)