Avoid sending HTTP headers when already sent
MODIFY
src/utils/Logging.ts
src/utils/Logging.ts
@@ -668,9 +668,11 @@ export default class Logging {
await Logging.logActionException(tenantID, action, exception);
}
// Send error
+ if (!res.headersSent) {
res.status(statusCode ? statusCode : HTTPError.GENERAL_ERROR).send({
'message': Utils.hideShowMessage(exception.message)
});
+ }
next();
}

Avoid sending HTTP headers when already sent