middleware/httpproxy: add debug queries (#446)

* middleware/httproxy: implement debug queries

Not too useful at the moment, but o-o.debug queries are supported
and return the Comment from dns.google.com.

Note that this is not always set.

* improve documentation

* Testing cleanups
This commit is contained in:
Miek Gieben 2016-11-29 09:54:57 +00:00 committed by GitHub
parent a1b9f96d87
commit 4cfd19c7c9
12 changed files with 108 additions and 55 deletions

View file

@ -5,6 +5,7 @@ import (
"github.com/miekg/coredns/middleware"
"github.com/miekg/coredns/middleware/etcd/msg"
"github.com/miekg/coredns/middleware/pkg/debug"
"github.com/miekg/coredns/middleware/pkg/dnsutil"
"github.com/miekg/coredns/request"
@ -21,10 +22,10 @@ func (e *Etcd) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (
}
name := state.Name()
if e.Debugging {
if debug := isDebug(name); debug != "" {
if bug := debug.IsDebug(name); bug != "" {
opt.Debug = r.Question[0].Name
state.Clear()
state.Req.Question[0].Name = debug
state.Req.Question[0].Name = bug
}
}