From: Russ Cox Date: Fri, 3 Feb 2017 01:37:29 +0000 (-0500) Subject: net/http: fix dns hijacking test X-Git-Tag: go1.9beta1~1770 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=64c5280844aa7d6cbec18c47750f9d3e65f5f72a;p=gostls13.git 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 TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/net/http/transport_test.go b/src/net/http/transport_test.go index e3de3eb91b..085bb3cd4b 100644 --- a/src/net/http/transport_test.go +++ b/src/net/http/transport_test.go @@ -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 {