mirror of
https://github.com/coredns/coredns.git
synced 2025-11-11 22:42:21 -05:00
middleware/caching: don't set TTL on OPT
When setting the TTL on all RR in the message we would also do this for the OPT RR. This is wrong as the OPT RR does *not* have a TTL.
This commit is contained in:
3
middleware/cache/item.go
vendored
3
middleware/cache/item.go
vendored
@@ -74,6 +74,9 @@ func setCap(m *dns.Msg, ttl uint32) {
|
||||
r.Header().Ttl = uint32(ttl)
|
||||
}
|
||||
for _, r := range m.Extra {
|
||||
if r.Header().Rrtype == dns.TypeOPT {
|
||||
continue
|
||||
}
|
||||
r.Header().Ttl = uint32(ttl)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user