Workaround heroku ssl with env var
This commit is contained in:
parent
c71273f701
commit
94a5d76af3
1 changed files with 1 additions and 1 deletions
|
@ -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];
|
||||
|
|
Loading…
Reference in a new issue