fix header detection
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -6,7 +6,6 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
"io"
|
"io"
|
||||||
"os"
|
"os"
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/anotherhadi/eleakxir/leak-utils/settings"
|
"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"}
|
knownHeaders := []string{"email", "password", "username", "phone", "lastname", "firstname", "mail", "addresse", "nom", "id"}
|
||||||
for _, knownHeader := range knownHeaders {
|
for _, knownHeader := range knownHeaders {
|
||||||
if slices.Contains(firstRow, knownHeader) {
|
for _, col := range firstRow {
|
||||||
return true, nil
|
if strings.HasPrefix(col, "_"+knownHeader) || col == knownHeader {
|
||||||
}
|
return true, nil
|
||||||
if slices.Contains(firstRow, "_"+knownHeader) {
|
}
|
||||||
return true, nil
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return false, nil
|
return false, nil
|
||||||
|
|||||||
Reference in New Issue
Block a user