Skip to content

Commit

Permalink
Merge branch 'main' into doppler-updates
Browse files Browse the repository at this point in the history
  • Loading branch information
joeleonjr authored Jan 22, 2024
2 parents 15e06e9 + 443ef98 commit d970653
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions pkg/detectors/zenscrape/zenscrape.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package zenscrape

import (
"context"
"io"
"net/http"
"regexp"
"strings"
Expand Down Expand Up @@ -48,28 +47,21 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
}

if verify {
req, err := http.NewRequestWithContext(ctx, "GET", "https://app.zenscrape.com/api/v1/get?url=http://www.google.com", nil)
req, err := http.NewRequestWithContext(ctx, "GET", "https://app.zenscrape.com/api/v1/status", nil)
if err != nil {
continue
}
req.Header.Add("apikey", resMatch)
res, err := client.Do(req)
if err == nil {
defer res.Body.Close()
bodyBytes, err := io.ReadAll(res.Body)
if err != nil {
continue
}
body := string(bodyBytes)

if !strings.Contains(body, "Not enough requests.") {
if (res.StatusCode >= 200 && res.StatusCode < 300) || res.StatusCode == 429 {
s1.Verified = true
} else {
if detectors.IsKnownFalsePositive(resMatch, detectors.DefaultFalsePositives, true) {
continue
}
}

}
}

Expand Down

0 comments on commit d970653

Please sign in to comment.