szmarczak / http-timer

🕐 Performance timings for HTTP requests
MIT License
192 stars 18 forks source link

`abort` listener should be removed after receiving `end` #27

Closed szmarczak closed 3 years ago

szmarczak commented 3 years ago

https://github.com/nodejs/node/blob/8d2e66cae33472f5d4017444fd4116a4db5667d2/lib/internal/streams/destroy.js#L311

https://github.com/nodejs/node/blob/8d2e66cae33472f5d4017444fd4116a4db5667d2/lib/internal/streams/readable.js#L1158

request.abort() is called when using for await (cost chunk of response)

szmarczak commented 3 years ago

This is a Node.js bug but I doubt they will fix this so let's fix it here. It just makes the timings incorrect.

szmarczak commented 3 years ago

Fixed in b8dabf9bbd64c71ed702064bb78123a70e7c069c