Skip to content

Find, verify, and analyze leaked credentials

[chore] Only set default detectors if none are provided (#3147)

Miccah38e844f96844
diff --git a/pkg/engine/engine.go b/pkg/engine/engine.go
index aa2b03ff9..22ed1cdcd 100644
--- a/pkg/engine/engine.go
+++ b/pkg/engine/engine.go
@@ -308,7 +308,10 @@ func (e *Engine) setDefaults(ctx context.Context) {
e.decoders = decoders.DefaultDecoders()
}
- e.detectors = append(e.detectors, DefaultDetectors()...)
+ // Only use the default detectors if none are provided.
+ if len(e.detectors) == 0 {
+ e.detectors = DefaultDetectors()
+ }
if e.dispatcher == nil {
e.dispatcher = NewPrinterDispatcher(new(output.PlainPrinter))