aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/setup.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/setup.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/setup.go')
-rw-r--r--plugin/rewrite/setup.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/plugin/rewrite/setup.go b/plugin/rewrite/setup.go
index f2151b2f3..4d75c99f8 100644
--- a/plugin/rewrite/setup.go
+++ b/plugin/rewrite/setup.go
@@ -3,10 +3,13 @@ package rewrite
import (
"github.com/coredns/coredns/core/dnsserver"
"github.com/coredns/coredns/plugin"
+ clog "github.com/coredns/coredns/plugin/pkg/log"
"github.com/mholt/caddy"
)
+var log = clog.NewWithPlugin("rewrite")
+
func init() {
caddy.RegisterPlugin("rewrite", caddy.Plugin{
ServerType: "dns",