diff --git a/app/router/config.go b/app/router/config.go index 16b8a9527..540e6b2e8 100644 --- a/app/router/config.go +++ b/app/router/config.go @@ -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 {