From f77f39e937cf020e6c9f283335d9bcb03be9e5b5 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Fri, 4 Dec 2015 08:31:09 -0500 Subject: [PATCH] Fixed #3925 Also updated port local variable to be a Number, since all of the conditional checks assume it is a number, when all along it has been a string.... heh. --- src/webserver.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/webserver.js b/src/webserver.js index 87b9f1a8cc..8bbf914a40 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -121,7 +121,7 @@ function cacheStaticFiles(callback) { } function listen(callback) { - var port = nconf.get('port'); + var port = parseInt(nconf.get('port'), 10); if (Array.isArray(port)) { if (!port.length) { @@ -138,7 +138,7 @@ function listen(callback) { } } - if (port !== 80 && port !== 443 && nconf.get('use_port') === false) { + if ((port !== 80 && port !== 443) || nconf.get('trust_proxy') === true) { winston.info('Enabling \'trust proxy\''); app.enable('trust proxy'); }