From 1e965769192e44d173266c3d226b664f26a3a36d Mon Sep 17 00:00:00 2001 From: Tomer Buhadana Date: Thu, 4 Jul 2024 15:27:45 +0300 Subject: [PATCH] remove ensure ascii flags from json stringify to match js stringify --- app/invokers/webhook_invoker.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/app/invokers/webhook_invoker.py b/app/invokers/webhook_invoker.py index 54fe137..26cc480 100644 --- a/app/invokers/webhook_invoker.py +++ b/app/invokers/webhook_invoker.py @@ -297,9 +297,8 @@ def validate_incoming_signature(self, msg: dict) -> bool: # Remove the headers to avoid them being used in the signature verification del msg["headers"]["X-Port-Signature"] del msg["headers"]["X-Port-Timestamp"] - expected_sig = sign_sha_256( - json.dumps(msg, separators=(",", ":")), + json.dumps(msg, separators=(",", ":"), ensure_ascii=False), settings.PORT_CLIENT_SECRET, port_timestamp, )