1
0
mirror of https://github.com/golang/go synced 2024-10-01 16:38:34 -06:00

net/http: fix dns hijacking test

The name lookups are unrooted; the test should be unrooted too.
Correctly skips the tests if the DNS config specifies a domain
suffix that has a wildcard entry causing all unrooted names to resolve.

Change-Id: I80470326a5d332f3b8d64663f765fd304c5e0811
Reviewed-on: https://go-review.googlesource.com/36253
Run-TryBot: Russ Cox <rsc@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Russ Cox 2017-02-02 20:37:29 -05:00 committed by Brad Fitzpatrick
parent 57546d67ec
commit 64c5280844

View File

@ -3436,7 +3436,7 @@ func skipIfDNSHijacked(t *testing.T) {
// DNS server hijacking queries.
// See issues 16732, 16716.
isDNSHijackedOnce.Do(func() {
addrs, _ := net.LookupHost("dns-should-not-resolve.golang.")
addrs, _ := net.LookupHost("dns-should-not-resolve.golang")
isDNSHijacked = len(addrs) != 0
})
if isDNSHijacked {