Skip to content

Commit

Permalink
reuse default client
Browse files Browse the repository at this point in the history
  • Loading branch information
rosecodym committed Jul 21, 2023
1 parent 5cf522e commit af642d6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/detectors/alchemy/alchemy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`)
)
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit af642d6

Please sign in to comment.