mirror of
https://github.com/coredns/coredns.git
synced 2025-10-29 09:14:17 -04:00
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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user