feat(botfilter): add matchesBlockedExtension
This commit is contained in:
1 parent
9030bb6102
commit
20b3e7f4ab
1 file changed
+11
+11
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user