Skip to content

Commit

Permalink
GODRIVER-2949 Ignore address case.
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu committed Nov 7, 2023
1 parent 26a8f94 commit 230eeb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions mongo/address/addr.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,11 @@ 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 a.Network() != "unix" {
// TODO: unicode case folding?
s = strings.ToLower(string(a))
}
if len(s) == 0 {
return ""
}
Expand Down
1 change: 1 addition & 0 deletions mongo/address/addr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ func TestAddress_String(t *testing.T) {
{"A:27017", "a:27017"},
{"a:27017", "a:27017"},
{"a.sock", "a.sock"},
{"A.sock", "A.sock"},
}

for _, test := range tests {
Expand Down

0 comments on commit 230eeb0

Please sign in to comment.