From 20b3e7f4abf78262b7e2eefedcd699742a2616b0 Mon Sep 17 00:00:00 2001 From: hoelee Date: Thu, 16 Apr 2026 08:08:00 +0800 Subject: [PATCH] feat(botfilter): add matchesBlockedExtension --- matcher.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/matcher.go b/matcher.go index eb1b2f81..8c99b45b 100644 --- a/matcher.go +++ b/matcher.go @@ -68,3 +68,14 @@ func matchesBlockedPath(paths, blockedPaths []string) bool { return false } +func matchesBlockedExtension(paths, extensions []string) bool { + for _, requestPath := range paths { + for _, extension := range extensions { + if strings.HasSuffix(requestPath, extension) { + return true + } + } + } + return false +} +