mirror of
https://codeberg.org/teddit/teddit.git
synced 2026-04-18 21:45:06 -04:00
fix an issue when url is undefined and post won't load
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user