v2.4.3: only print default message if there are no 'listening' listeners

This commit is contained in:
AJ ONeal 2018-08-18 02:03:04 -06:00
parent 1dae4248c3
commit b4d72bbd13
2 changed files with 3 additions and 3 deletions

View File

@ -119,7 +119,7 @@ module.exports.create = function (opts) {
// Report plain http status
if ('function' === typeof fnPlain) {
fnPlain.apply(plainServer);
} else if (!fn && plainServer.listenerCount('listening') < 2) {
} else if (!fn && !plainServer.listenerCount('listening') && !server.listenerCount('listening')) {
console.info('[:' + (plainServer.address().port || plainServer.address())
+ "] Handling ACME challenges and redirecting to " + server.type);
}
@ -127,7 +127,7 @@ module.exports.create = function (opts) {
// Report h2/https status
if ('function' === typeof fn) {
fn.apply(server);
} else if (server.listenerCount('listening') < 2) {
} else if (!server.listenerCount('listening')) {
console.info('[:' + (server.address().port || server.address()) + "] Serving " + server.type);
}
});

View File

@ -1,6 +1,6 @@
{
"name": "greenlock-express",
"version": "2.4.2",
"version": "2.4.3",
"description": "Free SSL and managed or automatic HTTPS for node.js with Express, Koa, Connect, Hapi, and all other middleware systems.",
"main": "index.js",
"homepage": "https://git.coolaj86.com/coolaj86/greenlock-express.js",