From 0bb6434a9967141ac8de1c6d7d0828fc83b86943 Mon Sep 17 00:00:00 2001 From: Justin Clark Date: Tue, 11 May 2021 15:13:21 -0600 Subject: [PATCH] Update webhook auth docstring The verify_signature method returns False if the event payload is decoded using utf-8 if special characters exist. The payload must be decoded using latin-1 to have it not fail on what should be successful authorizations. It is not clear from the current docstring what encoding to use when decoding the bytes payload --- sendgrid/helpers/eventwebhook/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sendgrid/helpers/eventwebhook/__init__.py b/sendgrid/helpers/eventwebhook/__init__.py index a44eb5b89..40b557818 100644 --- a/sendgrid/helpers/eventwebhook/__init__.py +++ b/sendgrid/helpers/eventwebhook/__init__.py @@ -33,7 +33,7 @@ def verify_signature(self, payload, signature, timestamp, public_key=None): """ Verify signed event webhook requests. - :param payload: event payload in the request body + :param payload: event payload in the request body decoded using latin-1 :type payload: string :param signature: value obtained from the 'X-Twilio-Email-Event-Webhook-Signature' header :type signature: string