feat(botfilter): add hasStaticAssetExtension

This commit is contained in:
hoelee committed 2026-04-16 08:08:00 +08:00
1 parent 850ed4ea48
commit 1fe889c4e3
1 file changed
+9
+9
View File
@@ -88,3 +88,12 @@ func pathMatchesAny(requestPath string, rules []string) bool {
return false
}
func hasStaticAssetExtension(requestPath string) bool {
for _, extension := range []string{".css", ".js", ".mjs", ".png", ".jpg", ".jpeg", ".gif", ".svg", ".webp", ".ico", ".woff", ".woff2"} {
if strings.HasSuffix(requestPath, extension) {
return true
}
}
return false
}