Yuki Takei 5 лет назад
Родитель
Сommit
6c1df62323

+ 5 - 0
packages/slackbot-proxy/src/controllers/slack.ts

@@ -129,6 +129,11 @@ export class SlackCtrl {
     // See https://api.slack.com/apis/connections/events-api#the-events-api__responding-to-events
     res.send();
 
+    // pass
+    if (body.ssl_check != null) {
+      return;
+    }
+
     const installationId = authorizeResult.enterpriseId || authorizeResult.teamId;
     // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
     const installation = await this.installationRepository.findByTeamIdOrEnterpriseId(installationId!);

+ 6 - 0
packages/slackbot-proxy/src/middlewares/authorizer.ts

@@ -86,6 +86,12 @@ export class AuthorizeInteractionMiddleware implements IMiddleware {
   async use(@Req() req: AuthedReq, @Res() res: Res): Promise<void> {
     const { body } = req;
 
+    if (body.payload == null) {
+      // do nothing
+      this.logger.info('body does not have payload');
+      return;
+    }
+
     const payload = JSON.parse(body.payload);
 
     // extract id from body