mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
plugin/template: Support NODATA responses (#1816)
A NODATA response has no answers and rcode NOERROR, but should have a SOA record in the authority section.
This commit is contained in:
committed by
Miek Gieben
parent
a40345d65f
commit
0d305387f7
@@ -159,7 +159,7 @@ func templateParse(c *caddy.Controller) (handler Handler, err error) {
|
||||
t.regex = append(t.regex, regexp.MustCompile(".*"))
|
||||
}
|
||||
|
||||
if len(t.answer) == 0 && len(t.additional) == 0 && t.rcode == dns.RcodeSuccess {
|
||||
if len(t.answer) == 0 && len(t.authority) == 0 && t.rcode == dns.RcodeSuccess {
|
||||
return handler, c.Errf("no answer section for template found: %v", handler)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user