mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-03 23:20:25 +08:00
[WAF]修复“包含字符串”操作符对字节数组的匹配错误
This commit is contained in:
@@ -384,13 +384,16 @@ func (this *Rule) Test(value interface{}) bool {
|
||||
return !utils.MatchStringCache(this.reg, types.String(value))
|
||||
case RuleOperatorContains:
|
||||
if types.IsSlice(value) {
|
||||
ok := false
|
||||
lists.Each(value, func(k int, v interface{}) {
|
||||
if types.String(v) == this.Value {
|
||||
ok = true
|
||||
}
|
||||
})
|
||||
return ok
|
||||
_, isBytes := value.([]byte)
|
||||
if !isBytes {
|
||||
ok := false
|
||||
lists.Each(value, func(k int, v interface{}) {
|
||||
if types.String(v) == this.Value {
|
||||
ok = true
|
||||
}
|
||||
})
|
||||
return ok
|
||||
}
|
||||
}
|
||||
if types.IsMap(value) {
|
||||
lowerValue := ""
|
||||
|
||||
Reference in New Issue
Block a user