feat(botfilter): add normalisePath

This commit is contained in:
hoelee committed 2026-01-14 09:58:00 +08:00
1 parent a150d3a74e
commit cc326c1736
1 file changed
+12
+12
View File
@@ -85,3 +85,15 @@ func normaliseExtensions(values []string) []string {
return result
}
func normalisePath(value string) string {
value = strings.TrimSpace(value)
if value == "" {
return ""
}
value = strings.ReplaceAll(value, "\\", "/")
if !strings.HasPrefix(value, "/") {
value = "/" + value
}
return strings.ToLower(pathpkg.Clean(value))
}