Merge current v2.9 into v3.0

This commit is contained in:
romain 2023-02-15 11:29:28 +01:00
commit 241fb5093a
18 changed files with 386 additions and 116 deletions

View file

@ -250,6 +250,16 @@ func Test_addTCPRoute(t *testing.T) {
serverName: "example.com",
matchErr: true,
},
{
desc: "Matching IPv4",
rule: "HostSNI(`127.0.0.1`)",
serverName: "127.0.0.1",
},
{
desc: "Matching IPv6",
rule: "HostSNI(`10::10`)",
serverName: "10::10",
},
}
for _, test := range testCases {
@ -332,6 +342,16 @@ func TestParseHostSNI(t *testing.T) {
expression: "hostsni(`example.com`)",
domain: []string{"example.com"},
},
{
desc: "HostSNI IPv4",
expression: "HostSNI(`127.0.0.1`)",
domain: []string{"127.0.0.1"},
},
{
desc: "HostSNI IPv6",
expression: "HostSNI(`10::10`)",
domain: []string{"10::10"},
},
{
desc: "No hostSNI rule",
expression: "ClientIP(`10.1`)",