From 297e60fd2e8401ca5db213b045b01d7bf10e9415 Mon Sep 17 00:00:00 2001 From: hoelee Date: Mon, 27 Apr 2026 08:08:00 +0800 Subject: [PATCH] feat(botfilter): add hasStaticAssetExtension --- matcher.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/matcher.go b/matcher.go index 80a852a7..d6b82a4d 100644 --- a/matcher.go +++ b/matcher.go @@ -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 +} +