From 15230cb361b10f51126947ea0d20fedf1c2a8d96 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Tue, 27 Jun 2023 00:48:25 +0100 Subject: [PATCH] Okay, put that back where it was because I inavertently overloaded my import Flashbacks to my java days... --- RIGS/views/rigboard.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/RIGS/views/rigboard.py b/RIGS/views/rigboard.py index 096fea86..75930b28 100644 --- a/RIGS/views/rigboard.py +++ b/RIGS/views/rigboard.py @@ -409,8 +409,7 @@ class RecieveForumWebhook(generic.View): return super().dispatch(request, *args, **kwargs) def post(self, request, *args, **kwargs): - hmac = hmac.new(env('FORUM_WEBHOOK_SECRET').encode(), request.body, hashlib.sha256).hexdigest() - computed = f"sha256={hmac}" + computed = f"sha256={hmac.new(env('FORUM_WEBHOOK_SECRET').encode(), request.body, hashlib.sha256).hexdigest()}" print(computed) if not hmac.compare_digest(request.POST.get('X-Discourse-Event-Signature'), computed): return HttpResponseForbidden('Invalid signature header')