[client] Match DNS wildcard handlers on label boundaries (#6255)

This commit is contained in:
Viktor Liu
2026-05-25 18:38:48 +02:00
committed by GitHub
parent b3b0feb3b8
commit 4983b5cf17
2 changed files with 62 additions and 2 deletions
+1 -2
View File
@@ -339,8 +339,7 @@ func (c *HandlerChain) isHandlerMatch(qname string, entry HandlerEntry) bool {
case entry.Pattern == ".":
return true
case entry.IsWildcard:
parts := strings.Split(strings.TrimSuffix(qname, entry.Pattern), ".")
return len(parts) >= 2 && strings.HasSuffix(qname, entry.Pattern)
return strings.HasSuffix(qname, "."+entry.Pattern)
default:
// For non-wildcard patterns:
// If handler wants subdomain matching, allow suffix match