mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46:12 +01:00
fix: awaiting res.render in send404 controller
> > A plugin wanted to use `response:rotuer.page` to 404 a specific page on some condition. res.render returns early in send404 and so must be awaited otherwise multiple responses will be sent
This commit is contained in:
@@ -49,5 +49,5 @@ exports.send404 = async function (req, res) {
|
||||
}
|
||||
|
||||
await middleware.buildHeaderAsync(req, res);
|
||||
res.render('404', { path: validator.escape(path), title: '[[global:404.title]]' });
|
||||
await res.render('404', { path: validator.escape(path), title: '[[global:404.title]]' });
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user