app: send port:0 instead of port:undefined
Node v6 no longer supports port:undefined, this commit is fixing app.listen() to correctly send port:0 when no port is specified.
This commit is contained in:
parent
462cec4c1c
commit
4d7154a31a
|
@ -565,7 +565,11 @@ app.listen = function(cb) {
|
||||||
(arguments.length == 1 && typeof arguments[0] == 'function');
|
(arguments.length == 1 && typeof arguments[0] == 'function');
|
||||||
|
|
||||||
if (useAppConfig) {
|
if (useAppConfig) {
|
||||||
server.listen(this.get('port'), this.get('host'), cb);
|
var port = this.get('port');
|
||||||
|
// NOTE(bajtos) port:undefined no longer works on node@6,
|
||||||
|
// we must pass port:0 explicitly
|
||||||
|
if (port === undefined) port = 0;
|
||||||
|
server.listen(port, this.get('host'), cb);
|
||||||
} else {
|
} else {
|
||||||
server.listen.apply(server, arguments);
|
server.listen.apply(server, arguments);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue