feat(botfilter): add containsToken
This commit is contained in:
1 parent
8818694d21
commit
2f0b3534e6
1 file changed
+9
@@ -50,3 +50,12 @@ func inspectRequest(r *http.Request, cfg *compiledConfig) matchResult {
|
||||
return result
|
||||
}
|
||||
|
||||
func containsToken(value string, tokens []string) bool {
|
||||
for _, token := range tokens {
|
||||
if strings.Contains(value, token) {
|
||||
return true
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user