From 35ae69192509f6406a855441a679bb413defaad3 Mon Sep 17 00:00:00 2001 From: Qingyang Hu Date: Tue, 7 Nov 2023 10:55:53 -0500 Subject: [PATCH] GODRIVER-2949 Ignore address case. --- mongo/address/addr.go | 3 +-- mongo/address/addr_test.go | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/mongo/address/addr.go b/mongo/address/addr.go index fb6abbcd7c..94f2fa0ba2 100644 --- a/mongo/address/addr.go +++ b/mongo/address/addr.go @@ -29,8 +29,7 @@ func (a Address) Network() string { // String is the canonical version of this address, e.g. localhost:27017, // 1.2.3.4:27017, example.com:27017. func (a Address) String() string { - // TODO: unicode case folding? - s := strings.ToLower(string(a)) + s := string(a) if len(s) == 0 { return "" } diff --git a/mongo/address/addr_test.go b/mongo/address/addr_test.go index 2242b6d49c..aeb2560500 100644 --- a/mongo/address/addr_test.go +++ b/mongo/address/addr_test.go @@ -18,8 +18,8 @@ func TestAddress_String(t *testing.T) { expected string }{ {"a", "a:27017"}, - {"A", "a:27017"}, - {"A:27017", "a:27017"}, + {"A", "A:27017"}, + {"A:27017", "A:27017"}, {"a:27017", "a:27017"}, {"a.sock", "a.sock"}, } @@ -37,8 +37,8 @@ func TestAddress_Canonicalize(t *testing.T) { expected string }{ {"a", "a:27017"}, - {"A", "a:27017"}, - {"A:27017", "a:27017"}, + {"A", "A:27017"}, + {"A:27017", "A:27017"}, {"a:27017", "a:27017"}, {"a.sock", "a.sock"}, }