Use defautl endpoints when no custom verifier provided. (#1242)
Lint / lint (push) Waiting to run
Release / Release (push) Waiting to run
Scan for secrets / test (push) Waiting to run
Snifftest / Run Snifftest (push) Waiting to run
Test / test (push) Waiting to run
Test / test-detectors (push) Waiting to run

This commit is contained in:
ahrav
2023-04-06 08:35:01 -07:00
committed by GitHub
parent b3d917f9c7
commit f107e1b497
3 changed files with 12 additions and 0 deletions
+4
View File
@@ -82,6 +82,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
if len(s.verifierURLs) == 0 {
s.verifierURLs = append(s.verifierURLs, defaultURL)
}
for _, match := range matches {
// First match is entire regex, second is the first group.
if len(match) != 2 {
+4
View File
@@ -63,6 +63,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
if len(s.verifierURLs) == 0 {
s.verifierURLs = append(s.verifierURLs, defaultURL)
}
for _, match := range matches {
if len(match) != 2 {
continue
+4
View File
@@ -62,6 +62,10 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result
matches := keyPat.FindAllStringSubmatch(dataStr, -1)
if len(s.verifierURLs) == 0 {
s.verifierURLs = append(s.verifierURLs, defaultURL)
}
for _, match := range matches {
if len(match) != 2 {
continue