mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-21 22:10:27 +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))
|
return !utils.MatchStringCache(this.reg, types.String(value))
|
||||||
case RuleOperatorContains:
|
case RuleOperatorContains:
|
||||||
if types.IsSlice(value) {
|
if types.IsSlice(value) {
|
||||||
ok := false
|
_, isBytes := value.([]byte)
|
||||||
lists.Each(value, func(k int, v interface{}) {
|
if !isBytes {
|
||||||
if types.String(v) == this.Value {
|
ok := false
|
||||||
ok = true
|
lists.Each(value, func(k int, v interface{}) {
|
||||||
}
|
if types.String(v) == this.Value {
|
||||||
})
|
ok = true
|
||||||
return ok
|
}
|
||||||
|
})
|
||||||
|
return ok
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if types.IsMap(value) {
|
if types.IsMap(value) {
|
||||||
lowerValue := ""
|
lowerValue := ""
|
||||||
|
|||||||
Reference in New Issue
Block a user