WAF增加“在IP列表内”操作符/优化部分操作符代号

This commit is contained in:
刘祥超
2023-01-08 10:15:46 +08:00
parent 8e68da7725
commit a2e6aaaa18
4 changed files with 14 additions and 38 deletions

View File

@@ -1,7 +0,0 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package values
func ParseIPList(v string) *StringList {
return ParseStringList(v, false)
}

View File

@@ -1,26 +0,0 @@
// Copyright 2022 Liuxiangchao iwind.liu@gmail.com. All rights reserved. Official site: https://goedge.cn .
package values_test
import (
"github.com/TeaOSLab/EdgeNode/internal/waf/values"
"github.com/iwind/TeaGo/assert"
"testing"
)
func TestParseIPList(t *testing.T) {
var a = assert.NewAssertion(t)
{
var list = values.ParseIPList("")
a.IsFalse(list.Contains("192.168.1.100"))
}
{
var list = values.ParseIPList(`
192.168.1.1
192.168.1.101`)
a.IsFalse(list.Contains("192.168.1.100"))
a.IsTrue(list.Contains("192.168.1.101"))
}
}