This commit is contained in:
AlecM33
2022-01-25 18:45:06 -05:00
parent 2c9e7c14f8
commit f9aa9e061a
3 changed files with 6 additions and 6 deletions

View File

@@ -56,9 +56,9 @@ const ServerBootstrapper = {
} else {
logger.warn('starting main in PRODUCTION mode. This should not be used for local development.');
main = http.createServer(app);
app.use(function(req,res,next) {
app.use(function (req, res, next) {
const schema = (req.headers['x-forwarded-proto'] || '').toLowerCase();
if (!req.path.includes('/_ah/start') && req.headers.host.indexOf('localhost')<0 && schema!=='https') {
if (!req.path.includes('/_ah/start') && req.headers.host.indexOf('localhost') < 0 && schema !== 'https') {
res.redirect('https://' + req.headers.host + req.url);
} else {
next();