mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
fix: #9287, generate csrf_token on 404
This commit is contained in:
@@ -43,6 +43,7 @@ exports.send404 = async function (req, res) {
|
||||
if (res.locals.isAPI) {
|
||||
return res.json({ path: validator.escape(path.replace(/^\/api/, '')), title: '[[global:404.title]]' });
|
||||
}
|
||||
await middleware.applyCSRFasync(req, res);
|
||||
await middleware.buildHeaderAsync(req, res);
|
||||
res.render('404', { path: validator.escape(path), title: '[[global:404.title]]' });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user