sharkcore / tweenz

Tweens for Express
7 stars 1 forks source link

Clean up 'finish' listeners when request is aborted #3

Closed magicmark closed 6 years ago

magicmark commented 6 years ago

https://brightinventions.pl/blog/http-request-logging-in-node/#when-the-request-is-finished

Not all the responses actually finish - when the request is aborted by the client or internal unhandled error is thrown, ServerResponse emits close and error events accordingly, instead, and we should also subscribe on them.