Skip to content

Commit 6ee7ffc

Browse files
authored
GODRIVER-2897 Add SRV test with capital letters in hostnames. (#1550)
1 parent 6e66b26 commit 6ee7ffc

File tree

3 files changed

+29
-2
lines changed

3 files changed

+29
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"uri": "mongodb+srv://TEST1.TEST.BUILD.10GEN.CC",
3+
"seeds": [
4+
"localhost.test.build.10gen.cc:27017",
5+
"localhost.test.build.10gen.cc:27018"
6+
],
7+
"hosts": [
8+
"localhost:27017",
9+
"localhost:27018",
10+
"localhost:27019"
11+
],
12+
"options": {
13+
"ssl": true
14+
},
15+
"ping": true
16+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
uri: "mongodb+srv://TEST1.TEST.BUILD.10GEN.CC"
2+
seeds:
3+
- localhost.test.build.10gen.cc:27017
4+
- localhost.test.build.10gen.cc:27018
5+
hosts:
6+
- localhost:27017
7+
- localhost:27018
8+
- localhost:27019
9+
options:
10+
ssl: true
11+
ping: true

x/mongo/driver/dns/dns.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -104,8 +104,8 @@ func (r *Resolver) fetchSeedlistFromSRV(host string, srvName string, stopOnErr b
104104
}
105105

106106
func validateSRVResult(recordFromSRV, inputHostName string) error {
107-
separatedInputDomain := strings.Split(inputHostName, ".")
108-
separatedRecord := strings.Split(recordFromSRV, ".")
107+
separatedInputDomain := strings.Split(strings.ToLower(inputHostName), ".")
108+
separatedRecord := strings.Split(strings.ToLower(recordFromSRV), ".")
109109
if len(separatedRecord) < 2 {
110110
return errors.New("DNS name must contain at least 2 labels")
111111
}

0 commit comments

Comments
 (0)