diff --git a/src/Webhook/index.ts b/src/Webhook/index.ts index ce42278..dab5d87 100644 --- a/src/Webhook/index.ts +++ b/src/Webhook/index.ts @@ -214,9 +214,7 @@ export default class Webhook { // See: https://github.com/WhatsApp/WhatsApp-Nodejs-SDK/blob/58ca3d5fceea604e18393734578d9a7944a37b15/src/utils.ts#L77-L82 // See: https://developers.facebook.com/docs/messenger-platform/webhooks#validate-payloads const getCalculatedSignature = (alg: string) => (appSecret: string) => - createHmac(alg, appSecret) - .update(bodyString, "utf-8") - .digest("hex"); + createHmac(alg, appSecret).update(bodyString, "utf8").digest("hex"); const checkSignature = (alg: string, signature: string) => { const signatureCalculator = getCalculatedSignature(alg);