Merge pull request #4104 from PieterGit/201811_update

fix INSECURE_USE_HTTP for people with nginx or apache
This commit is contained in:
PieterGit
2018-11-29 00:36:36 +01:00
committed by GitHub
+1 -1
View File
@@ -14,7 +14,7 @@ function create(env, ctx) {
var appInfo = env.name + ' ' + env.version;
app.set('title', appInfo);
app.enable('trust proxy'); // Allows req.secure test on heroku https connections.
if (!env.settings.isEnabled('insecureUseHttp')) {
if (!process.env.INSECURE_USE_HTTP=='true') {
app.use((req, res, next) => {
if (req.header('x-forwarded-proto') !== 'https')
res.redirect(`https://${req.header('host')}${req.url}`);