mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 10:43:17 -04:00
plugin/cache: remove item.Autoritative (#2885)
* plugin/cache: remove item.Autoritative Confuses clients if not set; remove it. Signed-off-by: Miek Gieben <miek@miek.nl> * Add extra comments on why we do this Signed-off-by: Miek Gieben <miek@miek.nl>
This commit is contained in:
7
plugin/cache/item.go
vendored
7
plugin/cache/item.go
vendored
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
type item struct {
|
||||
Rcode int
|
||||
Authoritative bool
|
||||
AuthenticatedData bool
|
||||
RecursionAvailable bool
|
||||
Answer []dns.RR
|
||||
@@ -25,7 +24,6 @@ type item struct {
|
||||
func newItem(m *dns.Msg, now time.Time, d time.Duration) *item {
|
||||
i := new(item)
|
||||
i.Rcode = m.Rcode
|
||||
i.Authoritative = m.Authoritative
|
||||
i.AuthenticatedData = m.AuthenticatedData
|
||||
i.RecursionAvailable = m.RecursionAvailable
|
||||
i.Answer = m.Answer
|
||||
@@ -56,7 +54,10 @@ func (i *item) toMsg(m *dns.Msg, now time.Time) *dns.Msg {
|
||||
m1 := new(dns.Msg)
|
||||
m1.SetReply(m)
|
||||
|
||||
m1.Authoritative = false
|
||||
// Set this to true as some DNS clients disgard the *entire* packet when it's non-authoritative.
|
||||
// This is probably not according to spec, but the bit itself is not super useful as this point, so
|
||||
// just set it to true.
|
||||
m1.Authoritative = true
|
||||
m1.AuthenticatedData = i.AuthenticatedData
|
||||
m1.RecursionAvailable = i.RecursionAvailable
|
||||
m1.Rcode = i.Rcode
|
||||
|
||||
Reference in New Issue
Block a user