mirror of
https://github.com/XTLS/Xray-core.git
synced 2025-06-12 11:29:36 +03:00
Support regex matching with attr (#2258)
* Support regex matching with attr * Add test case * Optimizing regex parsing at core start * simpliy
This commit is contained in:
@ -319,6 +319,19 @@ func TestRoutingRule(t *testing.T) {
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
rule: &RoutingRule{
|
||||
Attributes: map[string]string{
|
||||
"Custom": "p([a-z]+)ch",
|
||||
},
|
||||
},
|
||||
test: []ruleTest{
|
||||
{
|
||||
input: withContent(&session.Content{Attributes: map[string]string{"custom": "peach"}}),
|
||||
output: true,
|
||||
},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
for _, test := range cases {
|
||||
|
Reference in New Issue
Block a user