| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -975,6 +975,11 @@ function normalizeConnectArgs(listArgs) { | |||
| 975 | 975 | var options = args[0]; | |
| 976 | 976 | var cb = args[1]; | |
| 977 | 977 | ||
| 978 | + // If args[0] was options, then normalize dealt with it. | ||
| 979 | + // If args[0] is port, or args[0], args[1] is host,port, we need to | ||
| 980 | + // find the options and merge them in, normalize's options has only | ||
| 981 | + // the host/port/path args that it knows about, not the tls options. | ||
| 982 | + // This means that options.host overrides a host arg. | ||
| 978 | 983 | if (listArgs[1] !== null && typeof listArgs[1] === 'object') { | |
| 979 | 984 | options = util._extend(options, listArgs[1]); | |
| 980 | 985 | } else if (listArgs[2] !== null && typeof listArgs[2] === 'object') { | |
@@ -984,7 +989,7 @@ function normalizeConnectArgs(listArgs) { | |||
| 984 | 989 | return (cb) ? [options, cb] : [options]; | |
| 985 | 990 | } | |
| 986 | 991 | ||
| 987 | - exports.connect = function(/* [port, host], options, cb */) { | ||
| 992 | + exports.connect = function(/* [port,] [host,] [options,] [cb] */) { | ||
| 988 | 993 | const argsLen = arguments.length; | |
| 989 | 994 | var args = new Array(argsLen); | |
| 990 | 995 | for (var i = 0; i < argsLen; i++) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments