From 5d8ab112e0cbc9b6ef355566a7fb022668c67445 Mon Sep 17 00:00:00 2001 From: Robert Nagy Date: Tue, 17 Apr 2018 11:37:50 +0200 Subject: [PATCH] http: added aborted property to request PR-URL: https://github.com/nodejs/node/pull/20094 Reviewed-By: James M Snell Reviewed-By: Luigi Pinca --- doc/api/http.md | 12 +++++++++- doc/api/http2.md | 10 ++++++++ lib/_http_client.js | 2 ++ lib/_http_incoming.js | 2 ++ lib/_http_server.js | 1 + lib/internal/http2/compat.js | 7 ++++++ test/parallel/test-http-aborted.js | 26 +++++++++++++++++++++ test/parallel/test-http2-compat-aborted.js | 27 ++++++++++++++++++++++ 8 files changed, 86 insertions(+), 1 deletion(-) create mode 100644 test/parallel/test-http-aborted.js create mode 100644 test/parallel/test-http2-compat-aborted.js diff --git a/doc/api/http.md b/doc/api/http.md index 79ed99a388065d..4609cfe9adef54 100644 --- a/doc/api/http.md +++ b/doc/api/http.md @@ -1403,7 +1403,7 @@ following additional events, methods, and properties. added: v0.3.8 --> -Emitted when the request has been aborted and the network socket has closed. +Emitted when the request has been aborted. ### Event: 'close' + +* {boolean} + +The `message.aborted` property will be `true` if the request has +been aborted. + ### message.destroy([error]) + +* {boolean} + +The `request.aborted` property will be `true` if the request has +been aborted. + #### request.destroy([error])