From ac15ab3729fc9196ab9b354e4b4c22c310079c80 Mon Sep 17 00:00:00 2001 From: FreneticScribbler Date: Tue, 27 Jun 2023 00:55:04 +0100 Subject: [PATCH] Different header access method --- RIGS/views/rigboard.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/RIGS/views/rigboard.py b/RIGS/views/rigboard.py index 75930b28..67318967 100644 --- a/RIGS/views/rigboard.py +++ b/RIGS/views/rigboard.py @@ -411,7 +411,7 @@ class RecieveForumWebhook(generic.View): def post(self, request, *args, **kwargs): 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): + if not hmac.compare_digest(request.headers.get('X-Discourse-Event-Signature'), computed): return HttpResponseForbidden('Invalid signature header') body = json.loads(request.body.decode('utf-8')) event_id = int(body['title'][1:5]) # find the ID, force convert it to an int to eliminate leading zeros