aboutsummaryrefslogtreecommitdiff
path: root/plugin/cache/handler.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/cache/handler.go')
-rw-r--r--plugin/cache/handler.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/plugin/cache/handler.go b/plugin/cache/handler.go
index d5112fc69..e2b4155ee 100644
--- a/plugin/cache/handler.go
+++ b/plugin/cache/handler.go
@@ -17,6 +17,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
rc := r.Copy() // We potentially modify r, to prevent other plugins from seeing this (r is a pointer), copy r into rc.
state := request.Request{W: w, Req: rc}
do := state.Do()
+ ad := r.AuthenticatedData
zone := plugin.Zones(c.Zones).Matches(state.Name())
if zone == "" {
@@ -36,7 +37,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
ttl := 0
i := c.getIgnoreTTL(now, state, server)
if i == nil {
- crr := &ResponseWriter{ResponseWriter: w, Cache: c, state: state, server: server, do: do}
+ crr := &ResponseWriter{ResponseWriter: w, Cache: c, state: state, server: server, do: do, ad: ad}
return c.doRefresh(ctx, state, crr)
}
ttl = i.ttl(now)
@@ -62,7 +63,7 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
cw := newPrefetchResponseWriter(server, state, c)
go c.doPrefetch(ctx, state, cw, i, now)
}
- resp := i.toMsg(r, now, do)
+ resp := i.toMsg(r, now, do, ad)
w.WriteMsg(resp)
return dns.RcodeSuccess, nil