diff --git a/lib/_http_server.js b/lib/_http_server.js index 2d503f8098c58f..256dd867e26eb3 100644 --- a/lib/_http_server.js +++ b/lib/_http_server.js @@ -432,7 +432,7 @@ function connectionListener(socket) { // When we're finished writing the response, check if this is the last // respose, if so destroy the socket. - res.on('prefinish', resOnFinish); + res.on('finish', resOnFinish); function resOnFinish() { // Usually the first incoming element should be our request. it may // be that in the case abortIncoming() was called that the incoming