mirror of
https://github.com/nottinghamtec/PyRIGS.git
synced 2026-01-23 16:32:15 +00:00
Add debug print
This commit is contained in:
@@ -411,6 +411,7 @@ class RecieveForumWebhook(generic.View):
|
|||||||
def post(self, request, *args, **kwargs):
|
def post(self, request, *args, **kwargs):
|
||||||
hmac = hmac.new(env('FORUM_WEBHOOK_SECRET').encode(), request.body, hashlib.sha256).hexdigest()
|
hmac = hmac.new(env('FORUM_WEBHOOK_SECRET').encode(), request.body, hashlib.sha256).hexdigest()
|
||||||
computed = f"sha256={hmac}"
|
computed = f"sha256={hmac}"
|
||||||
|
print(computed)
|
||||||
if not hmac.compare_digest(request.POST.get('X-Discourse-Event-Signature'), computed):
|
if not hmac.compare_digest(request.POST.get('X-Discourse-Event-Signature'), computed):
|
||||||
return HttpResponseForbidden('Invalid signature header')
|
return HttpResponseForbidden('Invalid signature header')
|
||||||
body = json.loads(request.body.decode('utf-8'))
|
body = json.loads(request.body.decode('utf-8'))
|
||||||
|
|||||||
Reference in New Issue
Block a user