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

@ -2,6 +2,7 @@ package httpproxy
import (
"io/ioutil"
"log"
"os"
"strings"
"testing"
@ -9,7 +10,9 @@ import (
"github.com/mholt/caddy"
)
func TestSetupChaos(t *testing.T) {
func TestSetupHttpproxy(t *testing.T) {
log.SetOutput(ioutil.Discard)
tests := []struct {
input string
shouldErr bool
@ -55,7 +58,6 @@ func TestSetupChaos(t *testing.T) {
}
if err != nil {
t.Logf("%q", err)
if !test.shouldErr {
t.Errorf("Test %d: Expected no error but found one for input %s. Error was: %v", i, test.input, err)
}