diff options
Diffstat (limited to 'plugin/pkg/upstream/upstream.go')
-rw-r--r-- | plugin/pkg/upstream/upstream.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/plugin/pkg/upstream/upstream.go b/plugin/pkg/upstream/upstream.go index 8e1881a38..c0c50d2a8 100644 --- a/plugin/pkg/upstream/upstream.go +++ b/plugin/pkg/upstream/upstream.go @@ -2,6 +2,7 @@ package upstream import ( + "context" "fmt" "github.com/miekg/dns" @@ -18,8 +19,8 @@ type Upstream struct{} func New() *Upstream { return &Upstream{} } // Lookup routes lookups to our selves or forward to a remote. -func (u *Upstream) Lookup(state request.Request, name string, typ uint16) (*dns.Msg, error) { - server, ok := state.Context.Value(dnsserver.Key{}).(*dnsserver.Server) +func (u *Upstream) Lookup(ctx context.Context, state request.Request, name string, typ uint16) (*dns.Msg, error) { + server, ok := ctx.Value(dnsserver.Key{}).(*dnsserver.Server) if !ok { return nil, fmt.Errorf("no full server is running") } @@ -29,7 +30,7 @@ func (u *Upstream) Lookup(state request.Request, name string, typ uint16) (*dns. nw := nonwriter.New(state.W) - server.ServeDNS(state.Context, nw, req) + server.ServeDNS(ctx, nw, req) return nw.Msg, nil } |