Skip to content

Find, verify, and analyze leaked credentials

[bug] - Don't modify global client var (#1890)

ahrav5c721d1a7300
diff --git a/pkg/detectors/twilio/twilio.go b/pkg/detectors/twilio/twilio.go
index 7a18c6780..9588e858e 100644
--- a/pkg/detectors/twilio/twilio.go
+++ b/pkg/detectors/twilio/twilio.go
@@ -23,7 +23,6 @@ var (
identifierPat = regexp.MustCompile(`(?i)sid.{0,20}AC[0-9a-f]{32}`) // Should we have this? Seems restrictive.
sidPat = regexp.MustCompile(`\bAC[0-9a-f]{32}\b`)
keyPat = regexp.MustCompile(`\b[0-9a-f]{32}\b`)
- client = common.SaneHttpClient()
)
// Keywords are used for efficiently pre-filtering chunks.
@@ -59,7 +58,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}
if verify {
- client = s.client
+ client := s.client
if client == nil {
client = defaultClient
}