Skip to content

Commit 18924eb

Browse files
lukechildsBridgeAR
authored andcommitted
Save url for later, port_arg might be an object
1 parent 5d3c8f4 commit 18924eb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lib/createClient.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ module.exports = function createClient (port_arg, host_arg, options) {
2323
} else if (typeof port_arg === 'string' || port_arg && port_arg.url) {
2424

2525
options = utils.clone(port_arg.url ? port_arg : host_arg || options);
26-
var parsed = URL.parse(port_arg.url || port_arg, true, true);
26+
var url = port_arg.url || port_arg;
27+
var parsed = URL.parse(url, true, true);
2728

2829
// [redis:]//[[user][:password]@][host][:port][/db-number][?db=db-number[&password=bar[&option=value]]]
2930
if (parsed.slashes) { // We require slashes
@@ -59,7 +60,7 @@ module.exports = function createClient (port_arg, host_arg, options) {
5960
} else if (parsed.hostname) {
6061
throw new RangeError('The redis url must begin with slashes "//" or contain slashes after the redis protocol');
6162
} else {
62-
options.path = port_arg;
63+
options.path = url;
6364
}
6465

6566
} else if (typeof port_arg === 'object' || port_arg === undefined) {

0 commit comments

Comments
 (0)