http: return this from IncomingMessage#destroy() · nodejs/node@fb68487 · GitHub
Skip to content

Commit fb68487

Browse files
cjihrigaddaleax
authored andcommitted
http: return this from IncomingMessage#destroy()
This commit updates IncomingMessage#destroy() to return `this` for consistency with other readable streams. PR-URL: #32789 Fixes: #32772 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Michaël Zasso <targos@protonmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
1 parent 1b24d3a commit fb68487

3 files changed

Lines changed: 17 additions & 0 deletions

File tree

doc/api/http.md

Lines changed: 6 additions & 0 deletions

lib/_http_incoming.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ IncomingMessage.prototype._read = function _read(n) {
114114
IncomingMessage.prototype.destroy = function destroy(error) {
115115
if (this.socket)
116116
this.socket.destroy(error);
117+
return this;
117118
};
118119

119120

Lines changed: 10 additions & 0 deletions

0 commit comments

Comments
 (0)