truncated cache fix (#485)
This commit is contained in:
parent
a1215974ee
commit
c68dc7c1aa
1 changed files with 1 additions and 1 deletions
2
middleware/cache/handler.go
vendored
2
middleware/cache/handler.go
vendored
|
@ -25,9 +25,9 @@ func (c *Cache) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
|
||||||
do := state.Do() // TODO(): might need more from OPT record? Like the actual bufsize?
|
do := state.Do() // TODO(): might need more from OPT record? Like the actual bufsize?
|
||||||
|
|
||||||
if i, ok, expired := c.get(qname, qtype, do); ok && !expired {
|
if i, ok, expired := c.get(qname, qtype, do); ok && !expired {
|
||||||
|
|
||||||
resp := i.toMsg(r)
|
resp := i.toMsg(r)
|
||||||
state.SizeAndDo(resp)
|
state.SizeAndDo(resp)
|
||||||
|
resp, _ = state.Scrub(resp)
|
||||||
w.WriteMsg(resp)
|
w.WriteMsg(resp)
|
||||||
|
|
||||||
return dns.RcodeSuccess, nil
|
return dns.RcodeSuccess, nil
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue