Skip to content

Commit 84bfd23

Browse files
valentin2105zkat
authored andcommittedAug 3, 2018
config: stop filtering out non-ipv4 addresses from local-addrs (#35)
Fixes: #986 PR-URL: #35 Credit: @valentin2105 Reviewed-By: @zkat
1 parent af98e76 commit 84bfd23

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed
 

‎lib/config/defaults.js

+3-12
Original file line numberDiff line numberDiff line change
@@ -306,8 +306,6 @@ exports.types = {
306306
key: [null, String],
307307
'legacy-bundling': Boolean,
308308
link: Boolean,
309-
// local-address must be listed as an IP for a local network interface
310-
// must be IPv4 due to node bug
311309
'local-address': getLocalAddresses(),
312310
loglevel: ['silent', 'error', 'warn', 'notice', 'http', 'timing', 'info', 'verbose', 'silly'],
313311
logstream: Stream,
@@ -388,16 +386,9 @@ function getLocalAddresses () {
388386
interfaces = {}
389387
}
390388

391-
return Object.keys(interfaces).map(function (nic) {
392-
return interfaces[nic].filter(function (addr) {
393-
return addr.family === 'IPv4'
394-
})
395-
.map(function (addr) {
396-
return addr.address
397-
})
398-
}).reduce(function (curr, next) {
399-
return curr.concat(next)
400-
}, []).concat(undefined)
389+
return Object.keys(interfaces).map(
390+
nic => interfaces[nic].map(({address}) => address)
391+
).reduce((curr, next) => curr.concat(next), []).concat(undefined)
401392
}
402393

403394
exports.shorthands = {

0 commit comments

Comments
 (0)
Please sign in to comment.