mirror of
https://github.com/bckelley/cgm-remote-monitor.git
synced 2026-08-24 03:14:12 -05:00
Merge pull request #4104 from PieterGit/201811_update
fix INSECURE_USE_HTTP for people with nginx or apache
This commit is contained in:
@@ -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}`);
|
||||
|
||||
Reference in New Issue
Block a user