From e4ea0314782263ae2cc19bb0a7c2df62b47c7128 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Wed, 10 Jul 2019 13:12:37 +0200 Subject: [PATCH] http: added closed property --- doc/api/http.md | 18 ++++++++++++++++++ lib/_http_client.js | 17 +++++++++++------ lib/_http_incoming.js | 1 + lib/_http_outgoing.js | 1 + lib/_http_server.js | 14 +++++++++++--- lib/internal/http2/compat.js | 8 ++++++++ test/parallel/test-http-client-close-event.js | 1 + test/parallel/test-http-connect-req-res.js | 17 ++++++++++++++++- test/parallel/test-http-req-res-close.js | 7 +++---- test/parallel/test-http-response-close.js | 2 ++ 10 files changed, 72 insertions(+), 14 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