mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-18 22:12:14 +00:00
Okay, put that back where it was because I inavertently overloaded my import
Flashbacks to my java days...
This commit is contained in:
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user