Skip to content

Commit 0c0bc3b

Browse files
committed
Change json response to bytes.
1 parent 2394834 commit 0c0bc3b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mystbin/backend/routers/admin.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ async def release_hook(request: MystbinRequest):
260260
SECRET = config['github_secret'].encode()
261261

262262
received_sign = request.headers.get('X-Hub-Signature-256').split('sha256=')[-1].strip()
263-
expected_sign = HMAC(key=SECRET, msg=(await request.json()), digestmod=sha256).hexdigest()
263+
expected_sign = HMAC(key=SECRET, msg=(await request.json()).encode(), digestmod=sha256).hexdigest()
264264
if not compare_digest(received_sign, expected_sign):
265265
return UJSONResponse({"error": "Unauthorized"}, status_code=401)
266266

0 commit comments

Comments
 (0)