feat(botfilter): add hasStaticAssetExtension
This commit is contained in:
1 parent
850ed4ea48
commit
1fe889c4e3
1 file changed
+9
@@ -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
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user