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

@ -4,7 +4,6 @@ package etcd
import (
"sort"
"strings"
"testing"
"github.com/miekg/coredns/middleware/etcd/msg"
@ -14,21 +13,6 @@ import (
"github.com/miekg/dns"
)
func TestIsDebug(t *testing.T) {
if ok := isDebug("o-o.debug.miek.nl."); ok != "miek.nl." {
t.Errorf("expected o-o.debug.miek.nl. to be debug")
}
if ok := isDebug(strings.ToLower("o-o.Debug.miek.nl.")); ok != "miek.nl." {
t.Errorf("expected o-o.Debug.miek.nl. to be debug")
}
if ok := isDebug("i-o.debug.miek.nl."); ok != "" {
t.Errorf("expected i-o.Debug.miek.nl. to be non-debug")
}
if ok := isDebug(strings.ToLower("i-o.Debug.")); ok != "" {
t.Errorf("expected o-o.Debug. to be non-debug")
}
}
func TestDebugLookup(t *testing.T) {
etc := newEtcdMiddleware()
etc.Debugging = true