mirror of
https://github.com/TeaOSLab/EdgeNode.git
synced 2026-01-04 22:55:48 +08:00
WAF增加“在IP列表内”操作符/优化部分操作符代号
This commit is contained in:
@@ -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)
|
||||
}
|
||||
@@ -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"))
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user