mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Move nonwriter to mw/pkg/nonwriter (#948)
Make it its own package as shared between autopath and federation. Fixes #933
This commit is contained in:
@@ -17,6 +17,7 @@ import (
|
||||
"github.com/coredns/coredns/middleware"
|
||||
"github.com/coredns/coredns/middleware/etcd/msg"
|
||||
"github.com/coredns/coredns/middleware/pkg/dnsutil"
|
||||
"github.com/coredns/coredns/middleware/pkg/nonwriter"
|
||||
"github.com/coredns/coredns/request"
|
||||
|
||||
"github.com/miekg/dns"
|
||||
@@ -67,7 +68,7 @@ func (f *Federation) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.
|
||||
|
||||
// Start the next middleware, but with a nowriter, capture the result, if NXDOMAIN
|
||||
// perform federation, otherwise just write the result.
|
||||
nw := NewNonWriter(w)
|
||||
nw := nonwriter.New(w)
|
||||
ret, err := middleware.NextOrFailure(f.Name(), f.Next, ctx, nw, r)
|
||||
|
||||
if !middleware.ClientWrite(ret) {
|
||||
|
||||
Reference in New Issue
Block a user