From 8fbda0105cce360b1f90d28d6a62d91e88f7c177 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Mon, 17 Jun 2019 06:26:52 -0200 Subject: [PATCH 1/2] doc: clarify when http emits aborted event --- doc/api/http.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/doc/api/http.md b/doc/api/http.md index 0588d7f408f194..f694004c0eb838 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'` 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. From cbbc4030c05c245f35aedd8d2274d156390ff494 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Tue, 18 Jun 2019 05:41:42 -0200 Subject: [PATCH 2/2] Update doc/api/http.md Co-Authored-By: Rich Trott --- doc/api/http.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/api/http.md b/doc/api/http.md index f694004c0eb838..2c7a5d9fccb504 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -319,7 +319,7 @@ 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'` but instead emits 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