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
640
stars
48
forks
source link
http response writeable stream not ending when used in pipeline (node >= 11.1.0) #67
Starting in Node 11.1 and continuing to current Node 14 (11.0.0 and prior works fine)
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.
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!