aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/ttl_test.go
diff options
context:
space:
mode:
authorGravatar Uwe Krueger <uwe.krueger@sap.com> 2021-05-04 10:05:45 +0200
committerGravatar GitHub <noreply@github.com> 2021-05-04 10:05:45 +0200
commit40edf1e566a0b3709139420aeba542d9b788b1d0 (patch)
tree19b4e502cccd83b0ae5eb4b7b0107f845881877a /plugin/rewrite/ttl_test.go
parent696c8731d65b30e2562f89b16a4b12da79eb5ae9 (diff)
downloadcoredns-40edf1e566a0b3709139420aeba542d9b788b1d0.tar.gz
coredns-40edf1e566a0b3709139420aeba542d9b788b1d0.tar.zst
coredns-40edf1e566a0b3709139420aeba542d9b788b1d0.zip
plugin/rewrite: streamline the ResponseRule handling. (#4473)
* plugin/rewrite: streamline the ResponseRule handling. The functionality of a response rule is now completely encapsulated behind a `ResponseRule` interface. This significantly simplifies the complete processing flow, it enables more flexible response handling and it is possible to eliminate lots of state flags, ifs and switches. Based on the new flexibility the pull request also enables to support a response name rewrite for all name rewrite types. To be compatible, an explicit `answer auto` option is added to support a best effort response rewrite (name and value). Additionally now all name rewrite rules support additional name and value reponse rewrite options. Using this feature it is also possible now to rewrite a complete sub domain hierarchy to a single domain name combined with a correct rewrite (#2389). Signed-off-by: Uwe Krueger <uwe.krueger@sap.com> * revert policy Signed-off-by: Uwe Krueger <uwe.krueger@sap.com> Co-authored-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/rewrite/ttl_test.go')
-rw-r--r--plugin/rewrite/ttl_test.go5
1 files changed, 2 insertions, 3 deletions
diff --git a/plugin/rewrite/ttl_test.go b/plugin/rewrite/ttl_test.go
index 359807299..9ac0807ac 100644
--- a/plugin/rewrite/ttl_test.go
+++ b/plugin/rewrite/ttl_test.go
@@ -121,9 +121,8 @@ func doTTLTests(rules []Rule, t *testing.T) {
m.Question[0].Qclass = dns.ClassINET
m.Answer = tc.answer
rw := Rewrite{
- Next: plugin.HandlerFunc(msgPrinter),
- Rules: rules,
- noRevert: false,
+ Next: plugin.HandlerFunc(msgPrinter),
+ Rules: rules,
}
rec := dnstest.NewRecorder(&test.ResponseWriter{})
rw.ServeDNS(ctx, rec, m)