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:
parent
a1b9f96d87
commit
4cfd19c7c9
12 changed files with 108 additions and 55 deletions
|
@ -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)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue