mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2025-11-22 06:20:27 +08:00
[WAF]修复“包含字符串”操作符对字节数组的匹配错误
This commit is contained in:
@@ -384,6 +384,8 @@ 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) {
|
||||||
|
_, isBytes := value.([]byte)
|
||||||
|
if !isBytes {
|
||||||
ok := false
|
ok := false
|
||||||
lists.Each(value, func(k int, v interface{}) {
|
lists.Each(value, func(k int, v interface{}) {
|
||||||
if types.String(v) == this.Value {
|
if types.String(v) == this.Value {
|
||||||
@@ -392,6 +394,7 @@ func (this *Rule) Test(value interface{}) bool {
|
|||||||
})
|
})
|
||||||
return ok
|
return ok
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if types.IsMap(value) {
|
if types.IsMap(value) {
|
||||||
lowerValue := ""
|
lowerValue := ""
|
||||||
if this.IsCaseInsensitive {
|
if this.IsCaseInsensitive {
|
||||||
|
|||||||
Reference in New Issue
Block a user