feat(botfilter): add normaliseTokens
This commit is contained in:
1 parent
1c741d80f0
commit
66f6de689a
1 file changed
+10
@@ -50,3 +50,13 @@ func addressInPrefixes(addr netip.Addr, prefixes []netip.Prefix) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
func normaliseTokens(values []string) []string {
|
||||
result := make([]string, 0, len(values))
|
||||
for _, value := range values {
|
||||
if token := strings.ToLower(strings.TrimSpace(value)); token != "" {
|
||||
result = append(result, token)
|
||||
}
|
||||
}
|
||||
return result
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user