mirror of
https://github.com/coredns/coredns.git
synced 2026-07-14 19:50:10 -04:00
fix(log): synthesize deferred error responses (#8200)
Signed-off-by: immanuwell <pchpr.00@list.ru>
This commit is contained in:
committed by
GitHub
parent
1936a2bb40
commit
1539f9b7d6
@@ -35,6 +35,13 @@ func (l Logger) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||
|
||||
rrw := dnstest.NewRecorder(w)
|
||||
rc, err := plugin.NextOrFailure(l.Name(), l.Next, ctx, rrw, r)
|
||||
if rrw.Msg == nil && !plugin.ClientWrite(rc) {
|
||||
msg := new(dns.Msg)
|
||||
msg.SetRcode(r, rc)
|
||||
rrw.Msg = msg
|
||||
rrw.Rcode = rc
|
||||
rrw.Len = msg.Len()
|
||||
}
|
||||
|
||||
tpe, _ := response.Typify(rrw.Msg, time.Now().UTC())
|
||||
metadata.SetValueFunc(ctx, "log/type", func() string {
|
||||
|
||||
Reference in New Issue
Block a user