From 6e6895b48e319f00eba7fcebd15f1569d8319b2c Mon Sep 17 00:00:00 2001 From: Chris Atkin Date: Mon, 26 Jun 2023 16:44:17 +0100 Subject: [PATCH] Update Slack webhook error text for verification (#1427) This updates the matched error text to determine the verified status of a Slack webhook, as this has been updated on Slack's API. --- pkg/detectors/slackwebhook/slackwebhook.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/detectors/slackwebhook/slackwebhook.go b/pkg/detectors/slackwebhook/slackwebhook.go index 5cd82887c349..6a4a9d418cb8 100644 --- a/pkg/detectors/slackwebhook/slackwebhook.go +++ b/pkg/detectors/slackwebhook/slackwebhook.go @@ -62,7 +62,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result continue } body := string(bodyBytes) - if (res.StatusCode >= 200 && res.StatusCode < 300) || (res.StatusCode == 400 && strings.Contains(body, "no_text")) { + if (res.StatusCode >= 200 && res.StatusCode < 300) || (res.StatusCode == 400 && (strings.Contains(body, "no_text") || strings.Contains(body, "missing_text"))) { s1.Verified = true } }