mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
add site title to 404, on cold load anyways
This commit is contained in:
@@ -19,9 +19,17 @@ helpers.notFound = function(req, res, error) {
|
|||||||
error: error
|
error: error
|
||||||
});
|
});
|
||||||
} else if (res.locals.isAPI) {
|
} else if (res.locals.isAPI) {
|
||||||
res.status(404).json({path: req.path.replace(/^\/api/, ''), error: error});
|
res.status(404).json({
|
||||||
|
path: req.path.replace(/^\/api/, ''),
|
||||||
|
error: error,
|
||||||
|
title: '[[global:404.title]]'
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
res.status(404).render('404', {path: req.path, error: error});
|
res.status(404).render('404', {
|
||||||
|
path: req.path,
|
||||||
|
error: error,
|
||||||
|
title: '[[global:404.title]]'
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ function handle404(app, middleware) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
middleware.buildHeader(req, res, function() {
|
middleware.buildHeader(req, res, function() {
|
||||||
res.render('404', {path: req.path});
|
res.render('404', {path: req.path, title: '[[global:404.title]]'});
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
res.status(404).type('txt').send('Not found');
|
res.status(404).type('txt').send('Not found');
|
||||||
|
|||||||
Reference in New Issue
Block a user