Skip to content

Commit

Permalink
http: fix close return value mismatch between doc and implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
kylo5aby committed Feb 19, 2024
1 parent ec3040f commit 56d4c2b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -570,6 +570,7 @@ ObjectSetPrototypeOf(Server, net.Server);
Server.prototype.close = function() {
httpServerPreClose(this);
ReflectApply(net.Server.prototype.close, this, arguments);
return this;
};

Server.prototype[SymbolAsyncDispose] = async function() {
Expand Down
1 change: 1 addition & 0 deletions lib/https.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ Server.prototype.setTimeout = HttpServer.prototype.setTimeout;
Server.prototype.close = function() {
httpServerPreClose(this);
ReflectApply(tls.Server.prototype.close, this, arguments);
return this;
};

Server.prototype[SymbolAsyncDispose] = async function() {
Expand Down
1 change: 1 addition & 0 deletions test/parallel/test-http-server.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,5 @@ process.on('exit', function() {
assert.match(server_response, quit);

assert.strictEqual(client_got_eof, true);
assert.strictEqual(server.close(), server);
});

0 comments on commit 56d4c2b

Please sign in to comment.