提交 f155785e 编写于 作者: K Konstantin Vyatkin 提交者: Yiyu He

chore: support `writableEnded` (#1402)

上级 b968688a
......@@ -520,7 +520,11 @@ module.exports = {
get writable() {
// can't write any more after response finished
if (this.res.finished) return false;
// response.writableEnded is available since Node > 12.9
// https://nodejs.org/api/http.html#http_response_writableended
// response.finished is undocumented feature of previous Node versions
// https://stackoverflow.com/questions/16254385/undocumented-response-finished-in-node-js
if (this.res.writableEnded || this.res.finished) return false;
const socket = this.res.socket;
// There are already pending outgoing res, but still writable
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册