-
-
Notifications
You must be signed in to change notification settings - Fork 3
Description
What is the expected behavior?
When propagating events from emitters such as http.ClientRequest (.e.g response), we should be able to listen for the secondary events (e.g. data event).
What is the actual behavior?
The response object seems to be empty, so, for instance, data event is not emitted.
Possible solution
In the propagate function, the new source.emit function should propagate the return value of emiting the event in the destination emitter. If not, the node http module will dump the object. As stated in the node _http_client.js source code:
If the user did not listen for the 'response' event, then they can't possibly read the data, so we ._dump() it into the void so that the socket doesn't hang there in a paused state.
If this interpretation is correct, PR submitted with a possible solution.
How to reproduce the issue
PR submitted with a new test case that reflects the issue.
Does the bug have a test case?
Submitted with PR