Skip to content

Commit 3e79504

Browse files
committed
inspector: use Function#call() for stream.on('data', ...)
Signed-off-by: Darshan Sen <raisinten@gmail.com>
1 parent 2a2577b commit 3e79504

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/internal/inspector/network_http2.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ const {
2828
HTTP2_HEADER_STATUS,
2929
NGHTTP2_NO_ERROR,
3030
} = internalBinding('http2').constants;
31+
const EventEmitter = require('events');
3132

3233
const kRequestUrl = Symbol('kRequestUrl');
3334

@@ -181,7 +182,7 @@ function onClientStreamFinish({ stream, headers }) {
181182
},
182183
});
183184

184-
stream.on('data', (chunk) => {
185+
EventEmitter.prototype.on.call(stream, 'data', (chunk) => {
185186
/**
186187
* When a chunk of the response body has been received, cache it until `getResponseBody` request
187188
* https://chromedevtools.github.io/devtools-protocol/1-3/Network/#method-getResponseBody or

0 commit comments

Comments
 (0)