We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
writableEnded
1 parent b968688 commit f155785Copy full SHA for f155785
lib/response.js
@@ -520,7 +520,11 @@ module.exports = {
520
521
get writable() {
522
// can't write any more after response finished
523
- if (this.res.finished) return false;
+ // response.writableEnded is available since Node > 12.9
524
+ // https://nodejs.org/api/http.html#http_response_writableended
525
+ // response.finished is undocumented feature of previous Node versions
526
+ // https://stackoverflow.com/questions/16254385/undocumented-response-finished-in-node-js
527
+ if (this.res.writableEnded || this.res.finished) return false;
528
529
const socket = this.res.socket;
530
// There are already pending outgoing res, but still writable
0 commit comments