From 02b82d8a26f2df1522beec05af55380567cf4592 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 10 Jul 2019 13:12:37 +0200 Subject: [PATCH 1/2] http: added closed property --- doc/api/http.md | 18 ++++++++++++++++++ lib/_http_client.js | 6 ++++++ lib/_http_incoming.js | 1 + lib/_http_outgoing.js | 1 + lib/_http_server.js | 8 +++++++- lib/internal/http2/compat.js | 8 ++++++++ test/parallel/test-http-client-close-event.js | 1 + test/parallel/test-http-connect-req-res.js | 4 +++- test/parallel/test-http-req-res-close.js | 9 +++------ test/parallel/test-http-response-close.js | 2 ++ 10 files changed, 50 insertions(+), 8 deletions(-) diff --git a/doc/api/http.md b/doc/api/http.md index 0588d7f408f194..0f095f579e341e 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -553,6 +553,15 @@ changes: The `request.aborted` property will be `true` if the request has been aborted. +### request.closed + + +* {boolean} + +The `request.closed` property indicates whether the request has been closed. + ### request.connection + +* {boolean} + +The `response.closed` property indicates whether the response has been closed. + ### response.connection