diff --git a/lib/utils.js b/lib/utils.js index 43ab2873..46a9d3f9 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -26,7 +26,7 @@ function cloneArray (arr) { exports.extractHostname = function (req) { var headers = req.headers - , protocol = (req.connection.server instanceof tls.Server || req.headers['x-forwarded-proto'] == 'https') + , protocol = (req.connection.encrypted) ? 'https://' : 'http://' , host = headers.host;