npm / minipass-fetch

An implementation of window.fetch in Node.js using Minipass streams
Other
54 stars 11 forks source link

fix: do not setup the response timeout if the stream has already ended #53

Closed nlf closed 2 years ago

nlf commented 2 years ago

this change ensures we will not trigger a timeout caused by a slow stream pipeline if the stream has already ended. this subtly shifts the meaning of the timeout from "the response has been fully consumed" to "the socket behind the response has finished" which i feel maintains the spirit of the timeout while also not needlessly throwing errors when we're not using the socket any more.

fixes npm/cli#3078