Skip to content

Commit 0b12109

Browse files
Fixing tests
1 parent 1727360 commit 0b12109

File tree

2 files changed

+1
-9
lines changed

2 files changed

+1
-9
lines changed

lib/mongo/srv/result.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ def validate_same_origin!(record_host)
130130
raise Error::MismatchedDomain.new(MISMATCHED_DOMAINNAME % [record_host, srv_host_domain])
131131
end
132132

133-
unless (srv_host_domain == record_host_parts[-srv_host_domain.size..-1])
133+
unless (record_host_parts.size > srv_host_domain.size) && (srv_host_domain == record_host_parts[-srv_host_domain.size..-1])
134134
raise Error::MismatchedDomain.new(MISMATCHED_DOMAINNAME % [record_host, srv_host_domain])
135135
end
136136
end

spec/spec_tests/data/connection_string/invalid-uris.yml

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,6 @@ tests:
77
hosts: ~
88
auth: ~
99
options: ~
10-
-
11-
description: "Invalid scheme"
12-
uri: "mongo://localhost:27017"
13-
valid: false
14-
warning: ~
15-
hosts: ~
16-
auth: ~
17-
options: ~
1810
-
1911
description: "Missing host"
2012
uri: "mongodb://"

0 commit comments

Comments
 (0)