From af642d60a38a3771f68950f791fa8bb8dd5dc537 Mon Sep 17 00:00:00 2001 From: Cody Rose Date: Fri, 21 Jul 2023 14:11:10 -0400 Subject: [PATCH] reuse default client --- pkg/detectors/alchemy/alchemy.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/detectors/alchemy/alchemy.go b/pkg/detectors/alchemy/alchemy.go index e2be95e4478c..3834edb8df53 100644 --- a/pkg/detectors/alchemy/alchemy.go +++ b/pkg/detectors/alchemy/alchemy.go @@ -20,6 +20,7 @@ type Scanner struct { var _ detectors.Detector = (*Scanner)(nil) var ( + defaultClient = common.SaneHttpClient() // Make sure that your group is surrounded in boundary characters such as below to reduce false positives. keyPat = regexp.MustCompile(detectors.PrefixRegex([]string{"alchemy"}) + `\b([0-9a-zA-Z]{23}_[0-9a-zA-Z]{8})\b`) ) @@ -50,7 +51,7 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result if verify { client := s.client if client == nil { - client = common.SaneHttpClient() + client = defaultClient } req, err := http.NewRequestWithContext(ctx, "GET", "https://eth-mainnet.g.alchemy.com/v2/"+resMatch+"/getNFTs/?owner=vitalik.eth", nil) if err != nil {