Skip to content

Find, verify, and analyze leaked credentials

Remove `toLower` call on decoded chunk (#1254)

Zachary Rice1c89e79c2d9f
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
index 65ff22617..1603a01f4 100644
--- a/pkg/engine/engine.go
+++ b/pkg/engine/engine.go
@@ -247,11 +247,9 @@ func (e *Engine) detectorWorker(ctx context.Context) {
continue
}
- dataLower := strings.ToLower(string(decoded.Data))
- matches := e.prefilter.FindAll(dataLower)
-
- for _, m := range matches {
- matchedKeywords[dataLower[m.Start():m.End()]] = struct{}{}
+ // build a map of all keywords that were matched in the chunk
+ for _, m := range e.prefilter.FindAll(string(decoded.Data)) {
+ matchedKeywords[strings.ToLower(string(decoded.Data[m.Start():m.End()]))] = struct{}{}
}
for verify, detectorsSet := range e.detectors {