Skip to content

Commit 3cb3da3

Browse files
committed
fix(url-parser): bail early on validation when using domain socket
1 parent 93d01e1 commit 3cb3da3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/url_parser.js

+1
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@ function parseConnectionString(url, options) {
212212

213213
for (let i = 0; i < hosts.length; i++) {
214214
let r = parser.parse(f('mongodb://%s', hosts[i].trim()));
215+
if (r.path && r.path.indexOf('.sock') !== -1) continue;
215216
if (r.path && r.path.indexOf(':') !== -1) {
216217
// Not connecting to a socket so check for an extra slash in the hostname.
217218
// Using String#split as perf is better than match.

0 commit comments

Comments
 (0)