aboutsummaryrefslogtreecommitdiff
path: root/middleware/httpproxy/proxy.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2016-11-29 09:54:57 +0000
committerGravatar GitHub <noreply@github.com> 2016-11-29 09:54:57 +0000
commit4cfd19c7c97490dac47cd748166ec3f976e315aa (patch)
tree333b9851d6c5c80a374bf1084d2e012402710a87 /middleware/httpproxy/proxy.go
parenta1b9f96d876483b4356dddd83c24896d867e843c (diff)
downloadcoredns-4cfd19c7c97490dac47cd748166ec3f976e315aa.tar.gz
coredns-4cfd19c7c97490dac47cd748166ec3f976e315aa.tar.zst
coredns-4cfd19c7c97490dac47cd748166ec3f976e315aa.zip
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
Diffstat (limited to 'middleware/httpproxy/proxy.go')
-rw-r--r--middleware/httpproxy/proxy.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/middleware/httpproxy/proxy.go b/middleware/httpproxy/proxy.go
index 6b1243dff..3ef638a8f 100644
--- a/middleware/httpproxy/proxy.go
+++ b/middleware/httpproxy/proxy.go
@@ -27,9 +27,9 @@ func (p *Proxy) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg)
start := time.Now()
state := request.Request{W: w, Req: r}
- reply, backendErr := p.e.Exchange(r)
+ reply, backendErr := p.e.Exchange(state)
- if backendErr == nil {
+ if backendErr == nil && reply != nil {
state.SizeAndDo(reply)
w.WriteMsg(reply)