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:
Miek Gieben
2017-08-19 17:28:42 +01:00
committed by GitHub
parent 219a899772
commit 87eb0d39a4
6 changed files with 46 additions and 46 deletions

View File

@@ -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) {