pattern_matcher: check exact matches first
This commit is contained in:
parent
1239e64cd9
commit
0d260d0e2d
|
@ -120,6 +120,10 @@ func (patternMatcher *PatternMatcher) Eval(qName string) (reject bool, reason st
|
|||
return false, "", nil
|
||||
}
|
||||
|
||||
if xval := patternMatcher.blockedExact[qName]; xval != nil {
|
||||
return true, qName, xval
|
||||
}
|
||||
|
||||
revQname := StringReverse(qName)
|
||||
if match, xval, found := patternMatcher.blockedSuffixes.LongestPrefix([]byte(revQname)); found {
|
||||
if len(match) == len(revQname) || revQname[len(match)] == '.' {
|
||||
|
@ -153,9 +157,5 @@ func (patternMatcher *PatternMatcher) Eval(qName string) (reject bool, reason st
|
|||
}
|
||||
}
|
||||
|
||||
if xval := patternMatcher.blockedExact[qName]; xval != nil {
|
||||
return true, qName, xval
|
||||
}
|
||||
|
||||
return false, "", nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue