aboutsummaryrefslogtreecommitdiff
path: root/plugin/forward/truncated_test.go
diff options
context:
space:
mode:
authorGravatar Tobias Schmidt <tobidt@gmail.com> 2018-04-12 21:17:05 +0200
committerGravatar Miek Gieben <miek@miek.nl> 2018-04-12 20:17:05 +0100
commite671e22e657b2fcb1580abd311e9c340b20b9e96 (patch)
tree8b7217f3a91ff2efca75bf5c963745d8da850d03 /plugin/forward/truncated_test.go
parent305ae9b9bcade8c1a7b58b091b6fa2accf455a77 (diff)
downloadcoredns-e671e22e657b2fcb1580abd311e9c340b20b9e96.tar.gz
coredns-e671e22e657b2fcb1580abd311e9c340b20b9e96.tar.zst
coredns-e671e22e657b2fcb1580abd311e9c340b20b9e96.zip
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.
Diffstat (limited to 'plugin/forward/truncated_test.go')
-rw-r--r--plugin/forward/truncated_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugin/forward/truncated_test.go b/plugin/forward/truncated_test.go
index 4d8a0a25e..1c9e92a07 100644
--- a/plugin/forward/truncated_test.go
+++ b/plugin/forward/truncated_test.go
@@ -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 {