Skip to content

Commit

Permalink
GODRIVER-2897 Add SRV test with capital letters in hostnames. (mongod…
Browse files Browse the repository at this point in the history
  • Loading branch information
qingyang-hu authored Dec 18, 2023
1 parent 9d3a91c commit cc816b9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"uri": "mongodb+srv://TEST1.TEST.BUILD.10GEN.CC",
"seeds": [
"localhost.test.build.10gen.cc:27017",
"localhost.test.build.10gen.cc:27018"
],
"hosts": [
"localhost:27017",
"localhost:27018",
"localhost:27019"
],
"options": {
"ssl": true
},
"ping": true
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
uri: "mongodb+srv://TEST1.TEST.BUILD.10GEN.CC"
seeds:
- localhost.test.build.10gen.cc:27017
- localhost.test.build.10gen.cc:27018
hosts:
- localhost:27017
- localhost:27018
- localhost:27019
options:
ssl: true
ping: true
4 changes: 2 additions & 2 deletions x/mongo/driver/dns/dns.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,8 @@ func (r *Resolver) fetchSeedlistFromSRV(host string, srvName string, stopOnErr b
}

func validateSRVResult(recordFromSRV, inputHostName string) error {
separatedInputDomain := strings.Split(inputHostName, ".")
separatedRecord := strings.Split(recordFromSRV, ".")
separatedInputDomain := strings.Split(strings.ToLower(inputHostName), ".")
separatedRecord := strings.Split(strings.ToLower(recordFromSRV), ".")
if len(separatedRecord) < 2 {
return errors.New("DNS name must contain at least 2 labels")
}
Expand Down

0 comments on commit cc816b9

Please sign in to comment.