summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMatteo Collina <hello@matteocollina.com>2019-09-20 18:19:35 +0200
committerMatteo Collina <hello@matteocollina.com>2019-12-03 12:14:51 +0100
commit1b9fd7f6b8cbf14195f385bc839dba0b9a02f85e (patch)
tree54a36132f43776ba324558b18f8998e602973198 /lib
parent286b4536c5bf754150fc5e42db06acae9691da13 (diff)
downloadandroid-node-v8-1b9fd7f6b8cbf14195f385bc839dba0b9a02f85e.tar.gz
android-node-v8-1b9fd7f6b8cbf14195f385bc839dba0b9a02f85e.tar.bz2
android-node-v8-1b9fd7f6b8cbf14195f385bc839dba0b9a02f85e.zip
http: add captureRejection support to OutgoingMessage
PR-URL: https://github.com/nodejs/node/pull/27867 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaƫl Zasso <targos@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r--lib/_http_outgoing.js6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/_http_outgoing.js b/lib/_http_outgoing.js
index e331d073b5..c3bfbd09bf 100644
--- a/lib/_http_outgoing.js
+++ b/lib/_http_outgoing.js
@@ -32,6 +32,7 @@ const {
const { getDefaultHighWaterMark } = require('internal/streams/state');
const assert = require('internal/assert');
+const EE = require('events');
const Stream = require('stream');
const internalUtil = require('internal/util');
const { kOutHeaders, utcDate, kNeedDrain } = require('internal/http');
@@ -884,6 +885,11 @@ OutgoingMessage.prototype.pipe = function pipe() {
this.emit('error', new ERR_STREAM_CANNOT_PIPE());
};
+OutgoingMessage.prototype[EE.captureRejectionSymbol] =
+function(err, event) {
+ this.destroy(err);
+};
+
module.exports = {
OutgoingMessage
};