plugin: use Zones.Contains when any match suffices (#8505)

This commit is contained in:
Ilya Kulakov
2026-09-02 23:59:58 -07:00
committed by GitHub
parent f1d835aa51
commit c942ca7c36
16 changed files with 25 additions and 30 deletions

View File

@@ -468,7 +468,7 @@ func (w *ResponseWriter) set(m *dns.Msg, key uint64, mt response.Type, duration
// and key is valid
switch mt {
case response.NoError, response.Delegation:
if plugin.Zones(w.pexcept).Matches(m.Question[0].Name) != "" {
if plugin.Zones(w.pexcept).Contains(m.Question[0].Name) {
// zone is in exception list, do not cache
return
}
@@ -493,7 +493,7 @@ func (w *ResponseWriter) set(m *dns.Msg, key uint64, mt response.Type, duration
}
case response.NameError, response.NoData, response.ServerError:
if plugin.Zones(w.nexcept).Matches(m.Question[0].Name) != "" {
if plugin.Zones(w.nexcept).Contains(m.Question[0].Name) {
// zone is in exception list, do not cache
return
}