diff --git a/src/controllers/errors.js b/src/controllers/errors.js index 58f12d9f98..81e7fddebd 100644 --- a/src/controllers/errors.js +++ b/src/controllers/errors.js @@ -79,6 +79,9 @@ exports.handleErrors = async function handleErrors(err, req, res, next) { // esl if (res.locals.isAPI) { res.json(data); } else { + if (req.method === 'GET') { + await middleware.applyCSRFasync(req, res); + } await middleware.buildHeaderAsync(req, res); res.render('500', data); }