Automatic redirect to HTTPS when enabled (fixed)

merge-requests/256/head
Moe 2020-07-15 09:34:43 -07:00
parent 2707a13960
commit 24a9b2e6e4
1 changed files with 1 additions and 1 deletions

View File

@ -95,7 +95,7 @@ module.exports = function(s,config,lang,io){
})
app.use(function(req, res, next) {
if(!req.secure) {
return res.redirect(['https://', req.get('Host'), req.url].join(''));
return res.redirect(['https://', req.hostname,":",config.ssl.port, req.url].join(''));
}
next();
})