Inline connection util

This commit is contained in:
Mikołaj Pich 2019-04-14 19:56:19 +02:00
parent dc72b779ca
commit 2273751d00

View file

@ -1,6 +1,4 @@
function getProtocol(req) {
module.exports = function(req) {
let proto = req.connection.encrypted || process.env.SSL === 'true' ? 'https' : 'http';
return proto.split(/\s*,\s*/)[0];
}
module.exports = getProtocol;
};