Why is res.writable never set to false even though it is a WritableStream?

The following seems like very awkward behavior to me:

  • HTTP ServerResponse inherits from WritableStream
  • Therefore, when res.end() is called, the res.writable boolean should be set to false as per the documentation:

res.writable

A boolean that is true by default, but turns false after an 'error' occurred or end() / destroy() was called

However:

console.log(res.writable); //true
res.end();
console.log(res.writable); //true

Now, how do I check if the respons has already been sent? The req end event is emitted when the request ends, not when a response is sent. The res close event is never emitted, there is only a finish event but this one is not documented and therefore unsupported.