Use lowercase name for header getter

This commit is contained in:
Mikołaj Pich 2022-11-24 20:50:57 +01:00
parent 8990095d35
commit 3c0688693e

View file

@ -1,9 +1,7 @@
module.exports = function(req) {
const isConnectionEncrypted = req.connection.encrypted;
const isSslEnvSet = process.env.SSL === 'true';
const isHeaderSsl = req.header('X-Forwaded-Proto') === 'https';
console.log(req.headers);
const isHeaderSsl = req.header('x-forwarded-proto') === 'https';
const proto = isConnectionEncrypted || isSslEnvSet || isHeaderSsl ? 'https' : 'http';