How to determine for sure if Node.js server response is stopped?
use
if(response.writableEnded){
//doSomething();
}
response.finished is deprecated
You can check the finished
property on the response object:
if (res.finished) {
...
}
(never used it myself, so not sure if there are any potential problems to take into consideration when using it)