Skip to content

Commit

Permalink
Okay, put that back where it was because I inavertently overloaded my…
Browse files Browse the repository at this point in the history
… import

Flashbacks to my java days...
  • Loading branch information
FreneticScribbler committed Jun 26, 2023
1 parent b5b8dc1 commit 15230cb
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions RIGS/views/rigboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -409,8 +409,7 @@ def dispatch(self, request, *args, **kwargs):
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')
Expand Down

0 comments on commit 15230cb

Please sign in to comment.