diff --git a/src/utils/connection.js b/src/utils/connection.js index 58bed0b..6eb8269 100644 --- a/src/utils/connection.js +++ b/src/utils/connection.js @@ -1,5 +1,5 @@ function getProtocol(req) { - let proto = req.connection.encrypted ? 'https' : 'http'; + let proto = req.connection.encrypted || process.env.SSL === 'true' ? 'https' : 'http'; // only do this if you trust the proxy proto = req.headers['x-forwarded-proto'] || proto; return proto.split(/\s*,\s*/)[0];