From e47c263f712daa3d4e61bf0d88439d9fb0db1ebf Mon Sep 17 00:00:00 2001 From: Brandon Ly Date: Wed, 20 Dec 2023 10:03:35 -0600 Subject: [PATCH] [HOTFIX]: Use fallback slack header if they are not present (#955) --- src/services/slack.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/services/slack.ts b/src/services/slack.ts index b8b7db3b7..3b6cb53ed 100644 --- a/src/services/slack.ts +++ b/src/services/slack.ts @@ -85,8 +85,9 @@ export class SlackConnector implements ISlackConnector { validateSlackRequest(payload: any): boolean { // params needed to verify for slack - const headerSlackSignature = payload.headers['X-Slack-Signature'].toString(); // no idea why `typeof ` = object - const timestamp = payload.headers['X-Slack-Request-Timestamp']; + const headerSlackSignature = + payload.headers['X-Slack-Signature']?.toString() ?? payload.headers['x-slack-signature']?.toString(); // no idea why `typeof ` = object + const timestamp = payload.headers['X-Slack-Request-Timestamp'] ?? payload.headers['x-slack-request-timestamp']; const signingSecret = process.env.SLACK_SECRET; if (signingSecret) { const hmac = crypto.createHmac('sha256', signingSecret);