1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2026-05-07 21:19:07 -04:00

Apply domain selector choice

This commit is contained in:
Shelikhoo
2021-03-03 22:27:23 +00:00
parent 837d5e7618
commit 9d653dc708

View File

@@ -69,11 +69,21 @@ func (rr *RoutingRule) BuildCondition() (Condition, error) {
conds := NewConditionChan()
if len(rr.Domain) > 0 {
matcher, err := NewACAutomatonDomainMatcher(rr.Domain)
if err != nil {
return nil, newError("failed to build domain condition").Base(err)
switch rr.DomainMatcher {
case "ac":
matcher, err := NewACAutomatonDomainMatcher(rr.Domain)
if err != nil {
return nil, newError("failed to build domain condition").Base(err)
}
conds.Add(matcher)
default:
matcher, err := NewDomainMatcher(rr.Domain)
if err != nil {
return nil, newError("failed to build domain condition").Base(err)
}
conds.Add(matcher)
}
conds.Add(matcher)
}
if len(rr.UserEmail) > 0 {