diff --git a/lib/server/routes/export.js b/lib/server/routes/export.js index 16268480..65bb5c46 100644 --- a/lib/server/routes/export.js +++ b/lib/server/routes/export.js @@ -149,12 +149,10 @@ const exportHandler = async (request, response, next) => { let connectionAborted = false; // In case the connection is closed, force to abort further actions - request.socket.on('close', () => { - connectionAborted = true; - }); - - request.socket.on('clientError', () => { - connectionAborted = true; + request.socket.on('close', (hadErrors) => { + if (hadErrors) { + connectionAborted = true; + } }); log(4, `[export] Got an incoming HTTP request with ID ${uniqueId}.`);