From a3daa41fa052968c08ed14ed9d9892cf4d196e43 Mon Sep 17 00:00:00 2001 From: Hadi <112569860+anotherhadi@users.noreply.github.com> Date: Mon, 3 Nov 2025 13:31:35 +0100 Subject: [PATCH] fix header detection Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com> --- leak-utils/misc/csv.go | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/leak-utils/misc/csv.go b/leak-utils/misc/csv.go index 0d39eaa..fc71e6c 100644 --- a/leak-utils/misc/csv.go +++ b/leak-utils/misc/csv.go @@ -6,7 +6,6 @@ import ( "fmt" "io" "os" - "slices" "strings" "github.com/anotherhadi/eleakxir/leak-utils/settings" @@ -97,11 +96,10 @@ func csvHasHeader(inputFile, delimiter string) (hasHeader bool, err error) { } knownHeaders := []string{"email", "password", "username", "phone", "lastname", "firstname", "mail", "addresse", "nom", "id"} for _, knownHeader := range knownHeaders { - if slices.Contains(firstRow, knownHeader) { - return true, nil - } - if slices.Contains(firstRow, "_"+knownHeader) { - return true, nil + for _, col := range firstRow { + if strings.HasPrefix(col, "_"+knownHeader) || col == knownHeader { + return true, nil + } } } return false, nil