Explorar o código

add returntype

zahmis %!s(int64=5) %!d(string=hai) anos
pai
achega
626df76145
Modificáronse 1 ficheiros con 2 adicións e 3 borrados
  1. 2 3
      packages/slack/src/middlewares/protect-reply-attack.ts

+ 2 - 3
packages/slack/src/middlewares/protect-reply-attack.ts

@@ -1,9 +1,8 @@
 import { createHmac, timingSafeEqual } from 'crypto';
 import { createHmac, timingSafeEqual } from 'crypto';
 import { stringify } from 'qs';
 import { stringify } from 'qs';
 
 
-export const protectReplyAttack = (req, res, next) => {
-// protect against replay attacks
-
+export const protectReplyAttack = (req, res, next):Record<string, any>| void => {
+  // protect against replay attacks
   // take out slackSignature and timestamp from header
   // take out slackSignature and timestamp from header
   const slackSignature = req.headers['x-slack-signature'];
   const slackSignature = req.headers['x-slack-signature'];
   const timestamp = req.headers['x-slack-request-timestamp'];
   const timestamp = req.headers['x-slack-request-timestamp'];