aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/reverter.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-07-13 14:32:07 +0100
committerGravatar Paul Greenberg <greenpau@users.noreply.github.com> 2018-07-13 09:32:07 -0400
commitd9b9a955ba900f2e56f1cc160e2cce13a239b18b (patch)
treedae0c50a6aadccc673b00bea81491251db92bc5e /plugin/rewrite/reverter.go
parent8d9cf95ee8b52b730e5d0f4336a2832e3c433371 (diff)
downloadcoredns-d9b9a955ba900f2e56f1cc160e2cce13a239b18b.tar.gz
coredns-d9b9a955ba900f2e56f1cc160e2cce13a239b18b.tar.zst
coredns-d9b9a955ba900f2e56f1cc160e2cce13a239b18b.zip
plugin/rewrite: prevent illegal names (#1972)
Log and returns an error when the name rewrite creates a name that is illegal. Add test in name_test.go to see if an error is returned. Possible followup could be the only check this if a name-rewrite is done. Fixes: #1638 Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/rewrite/reverter.go')
-rw-r--r--plugin/rewrite/reverter.go9
1 files changed, 1 insertions, 8 deletions
diff --git a/plugin/rewrite/reverter.go b/plugin/rewrite/reverter.go
index 44b3caa30..63e38708f 100644
--- a/plugin/rewrite/reverter.go
+++ b/plugin/rewrite/reverter.go
@@ -17,7 +17,7 @@ type ResponseRule struct {
// ResponseReverter reverses the operations done on the question section of a packet.
// This is need because the client will otherwise disregards the response, i.e.
-// dig will complain with ';; Question section mismatch: got miek.nl/HINFO/IN'
+// dig will complain with ';; Question section mismatch: got example.org/HINFO/IN'
type ResponseReverter struct {
dns.ResponseWriter
originalQuestion dns.Question
@@ -64,10 +64,3 @@ func (r *ResponseReverter) Write(buf []byte) (int, error) {
n, err := r.ResponseWriter.Write(buf)
return n, err
}
-
-// Hijack implements dns.Hijacker. It simply wraps the underlying
-// ResponseWriter's Hijack method if there is one, or returns an error.
-func (r *ResponseReverter) Hijack() {
- r.ResponseWriter.Hijack()
- return
-}