Skip to content

Commit 5f12a95

Browse files
authored
Fix adding options.host to defaultHosts list
1 parent 123a06f commit 5f12a95

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

lib/portfinder.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,8 @@ exports.getPort = function (options, callback) {
141141
}
142142
}
143143

144-
if (options.host) {
145-
if (exports._defaultHosts.indexOf(options.host) !== -1) {
146-
exports._defaultHosts.push(options.host)
147-
}
144+
if (options.host && exports._defaultHosts.indexOf(options.host) === -1) {
145+
exports._defaultHosts.push(options.host)
148146
}
149147

150148
var openPorts = [], currentHost;

0 commit comments

Comments
 (0)