From 5806f9bb399ffc88fa631afbbd3837354d24457a Mon Sep 17 00:00:00 2001 From: mzz2017 <2017@duck.com> Date: Sat, 18 Feb 2023 19:02:34 +0800 Subject: [PATCH] fix: missing regex domain matching --- component/routing/domain_matcher/ahocorasick.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/component/routing/domain_matcher/ahocorasick.go b/component/routing/domain_matcher/ahocorasick.go index a0b7eff..4060e52 100644 --- a/component/routing/domain_matcher/ahocorasick.go +++ b/component/routing/domain_matcher/ahocorasick.go @@ -113,6 +113,12 @@ func (n *Ahocorasick) Build() error { n.matchers[i] = ahocorasick.NewMatcher(toBuild) n.validIndexes = append(n.validIndexes, i) } + for i := range n.regexp { + if len(n.regexp[i]) == 0 { + continue + } + n.validRegexpIndexes = append(n.validRegexpIndexes, i) + } // Release it. n.toBuild = nil return nil