[fix] it's named body in sanic

This commit is contained in:
Laurent Peuch 2019-02-05 23:10:44 +01:00
parent 0d746a6efc
commit 1b522269bb

View file

@ -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.data, digestmod=hashlib.sha1)
mac = hmac.new(str(secret), msg=request.body, digestmod=hashlib.sha1)
if not hmac.compare_digest(str(mac.hexdigest()), str(signature)):
abort(403)