Skip to content

Commit

Permalink
What if I gave it the right arguments. That might be a good start.
Browse files Browse the repository at this point in the history
  • Loading branch information
FreneticScribbler committed Jun 26, 2023
1 parent f762227 commit 63eb3be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion RIGS/views/rigboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -408,7 +408,7 @@ def dispatch(self, request, *args, **kwargs):
return super().dispatch(request, *args, **kwargs)

def post(self, request, *args, **kwargs):
computed = f"sha256={hmac.new(env('FORUM_WEBHOOK_SECRET'), request.body).hexdigest()}"
computed = f"sha256={hmac.new(env('FORUM_WEBHOOK_SECRET').encode(), request.body, digestmod='sha256').hexdigest()}"
if request.POST.get('X-Discourse-Event-Signature') == computed: # and request.POST.get('X-Discourse-Event') == "topic_created":
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
Expand Down

0 comments on commit 63eb3be

Please sign in to comment.