Commit 8b6fa668 authored by Andrei Tudor Călin's avatar Andrei Tudor Călin Committed by Brad Fitzpatrick

net: use case-insensitive host string comparison in TestLookupGmailNS

Some nameservers alter the case of NS records they return, e.g.
ns2.google.COm. or ns2.google.coM. Change TestLookupGmailNS to account
for this possibility by comparing host names in lower case.

Fixes #34446

Change-Id: I6ccb5b87b42401e04c9b32cecb8b7b4267b654cc
Reviewed-on: https://go-review.googlesource.com/c/go/+/196801Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent a14efb1b
...@@ -193,7 +193,9 @@ func TestLookupGmailNS(t *testing.T) { ...@@ -193,7 +193,9 @@ func TestLookupGmailNS(t *testing.T) {
t.Error("got no record") t.Error("got no record")
} }
for _, ns := range nss { for _, ns := range nss {
if !strings.HasSuffix(ns.Host, tt.host) { // Some nameservers alter the case of NS records. See #34446.
host := strings.ToLower(ns.Host)
if !strings.HasSuffix(host, tt.host) {
t.Errorf("got %v; want a record containing %s", ns, tt.host) t.Errorf("got %v; want a record containing %s", ns, tt.host)
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment