Skip to content

Commit

Permalink
fix: awaiting res.render in send404 controller
Browse files Browse the repository at this point in the history
>
> 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
  • Loading branch information
julianlam committed Feb 17, 2021
1 parent 65c57c7 commit 2fef462
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/controllers/404.js
Original file line number Diff line number Diff line change
Expand Up @@ -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]]' });
};

0 comments on commit 2fef462

Please sign in to comment.