Skip to content

Commit c87abaf

Browse files
authored
Merge pull request #148 from MasterOdin/patch-1
Fix adding options.host to defaultHosts list
2 parents b70f227 + 5f12a95 commit c87abaf

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
@@ -143,10 +143,8 @@ exports.getPort = function (options, callback) {
143143
}
144144
}
145145

146-
if (options.host) {
147-
if (exports._defaultHosts.indexOf(options.host) !== -1) {
148-
exports._defaultHosts.push(options.host)
149-
}
146+
if (options.host && exports._defaultHosts.indexOf(options.host) === -1) {
147+
exports._defaultHosts.push(options.host)
150148
}
151149

152150
var openPorts = [], currentHost;

0 commit comments

Comments
 (0)