fix an issue when url is undefined and post won't load

This commit is contained in:
teddit
2020-11-28 17:37:18 +01:00
parent 972865d50f
commit 30a0b24258
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -82,7 +82,7 @@ if(redirect_www) {
if(req.headers.host) {
if(req.headers.host.slice(0, 4) === 'www.') {
let newhost = req.headers.host.slice(4)
return res.redirect(301, req.protocol + '://' + newhost + req.originalUrl)
return res.redirect(301, `${req.protocol}://${newhost}${req.originalUrl}`)
}
}
next()