diff options
author | 2016-04-12 21:30:08 +0100 | |
---|---|---|
committer | 2016-04-12 21:30:08 +0100 | |
commit | 27ff83e70f554314b8162d2a3d29d26023e7bd6c (patch) | |
tree | e08c28d4d5abbb607c335c74f117094116743f97 /middleware/proxy | |
parent | 9f651a397baabcd7d1876771f8568e14d7b4b6ef (diff) | |
download | coredns-27ff83e70f554314b8162d2a3d29d26023e7bd6c.tar.gz coredns-27ff83e70f554314b8162d2a3d29d26023e7bd6c.tar.zst coredns-27ff83e70f554314b8162d2a3d29d26023e7bd6c.zip |
Stub forward/proxy tests (#108)
Test the handling of EDNS0 payloads and forwarding to stubzones
servers.
Diffstat (limited to 'middleware/proxy')
-rw-r--r-- | middleware/proxy/lookup.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/middleware/proxy/lookup.go b/middleware/proxy/lookup.go index a401705f2..92ce9ae2c 100644 --- a/middleware/proxy/lookup.go +++ b/middleware/proxy/lookup.go @@ -12,6 +12,7 @@ import ( "github.com/miekg/dns" ) +// New create a new proxy with the hosts in host and a Random policy. func New(hosts []string) Proxy { p := Proxy{Next: nil, Client: Clients()} @@ -31,7 +32,7 @@ func New(hosts []string) Proxy { Fails: 0, FailTimeout: upstream.FailTimeout, Unhealthy: false, - ExtraHeaders: upstream.proxyHeaders, + ExtraHeaders: upstream.proxyHeaders, // TODO(miek): fixer the fix CheckDown: func(upstream *staticUpstream) UpstreamHostDownFunc { return func(uh *UpstreamHost) bool { if uh.Unhealthy { @@ -80,6 +81,7 @@ func (p Proxy) lookup(state middleware.State, r *dns.Msg) (*dns.Msg, error) { for time.Now().Sub(start) < tryDuration { host := upstream.Select() if host == nil { + // TODO(miek): if all HC fail, spray the targets. return nil, errUnreachable } |