plugin/forward: Return original message on truncation (#1674)
With this change the original truncated message returned by requested server is returned to the client, instead of returning an empty dummy message with only the truncation bit set.
This commit is contained in:
parent
305ae9b9bc
commit
e671e22e65
2 changed files with 7 additions and 1 deletions
|
@ -49,6 +49,9 @@ func TestLookupTruncated(t *testing.T) {
|
|||
if !resp.Truncated {
|
||||
t.Error("Expected to receive reply with TC bit set, but didn't")
|
||||
}
|
||||
if len(resp.Answer) != 1 {
|
||||
t.Error("Expected to receive original reply, but answer is missing")
|
||||
}
|
||||
|
||||
resp, err = f.Lookup(state, "example.org.", dns.TypeA)
|
||||
if err != nil {
|
||||
|
@ -102,6 +105,9 @@ func TestForwardTruncated(t *testing.T) {
|
|||
if !resp.Truncated {
|
||||
t.Error("Expected to receive reply with TC bit set, but didn't")
|
||||
}
|
||||
if len(resp.Answer) != 1 {
|
||||
t.Error("Expected to receive original reply, but answer is missing")
|
||||
}
|
||||
|
||||
resp, err = f.Forward(state)
|
||||
if err != nil {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue