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>
This commit is contained in:
parent
8d9cf95ee8
commit
d9b9a955ba
6 changed files with 63 additions and 10 deletions
|
@ -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",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue