From 359e20f04882c6ccb75256850538db9eefdc6ac9 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 17 Jun 2019 06:26:52 -0200 Subject: [PATCH] doc: clarify when http emits aborted event PR-URL: https://github.com/nodejs/node/pull/28262 Refs: https://github.com/nodejs/node/issues/28172 Reviewed-By: Rich Trott Reviewed-By: Trivikram Kamat Reviewed-By: Franziska Hinkelmann Reviewed-By: Ruben Bridgewater --- doc/api/http.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index da0de7c1e68603..a19e09150eee03 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -318,6 +318,10 @@ Until the data is consumed, the `'end'` event will not fire. Also, until the data is read it will consume memory that can eventually lead to a 'process out of memory' error. +Unlike the `request` object, if the response closes prematurely, the +`response` object does not emit an `'error'` event but instead emits the +`'aborted'` event. + Node.js does not check whether Content-Length and the length of the body which has been transmitted are equal or not.