diff --git a/src/controllers/errors.js b/src/controllers/errors.js index 5677b66007..58f12d9f98 100644 --- a/src/controllers/errors.js +++ b/src/controllers/errors.js @@ -49,6 +49,9 @@ exports.handleErrors = async function handleErrors(err, req, res, next) { // esl }, }; const defaultHandler = async function () { + if (res.headersSent) { + return; + } // Display NodeBB error page const status = parseInt(err.status, 10); if ((status === 302 || status === 308) && err.path) {