fix: missing regex domain matching

This commit is contained in:
mzz2017 2023-02-18 19:02:34 +08:00
parent e15cae9377
commit 5806f9bb39

View File

@ -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