From 9d653dc7084f2946dc5cbd680596d368861d4569 Mon Sep 17 00:00:00 2001 From: Shelikhoo Date: Wed, 3 Mar 2021 22:27:23 +0000 Subject: [PATCH] Apply domain selector choice --- app/router/config.go | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) 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 {