moll / node-mitm

Intercept and mock outgoing Node.js network TCP connections and HTTP requests for testing. Intercepts and gives you a Net.Socket, Http.IncomingMessage and Http.ServerResponse to test and respond with. Super useful when testing code that hits remote servers.
Other
641 stars 48 forks source link

http response writeable stream not ending when used in pipeline (node >= 11.1.0) #67

Open kevinmstephens opened 4 years ago

kevinmstephens commented 4 years ago

We are seeing an issue with MITM involving:

When we use the http response writeable stream provided by MITM in the nodejs internal streams pipeline method the pipeline callback is never invoked.

We have created a repo with an implementation and tests showing the problem. If you run yarn test with node v11.0.0 the tests will pass, if you run with v11.1.1 they will timeout.

https://github.com/FormidableLabs/mitm-experiments

The callback not invoked that should be is here: https://github.com/FormidableLabs/mitm-experiments/blob/main/index.js#L126

Thanks for your help!

moll commented 4 years ago

Hey,

Thanks for the report. I'll see what I can find out!

Burnett2k commented 3 years ago

Hi @moll . Any updates on this?