http: fix close
return value mismatch between doc and implementation
PR-URL: https://github.com/nodejs/node/pull/51797 Fixes: https://github.com/nodejs/node/issues/51787 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Ethan Arrowood <ethan@arrowood.dev> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Marco Ippolito <marcoippolito54@gmail.com>
This commit is contained in:
parent
6cb8a60bcc
commit
60ce0783a2
@ -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() {
|
||||
|
@ -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() {
|
||||
|
@ -139,4 +139,5 @@ process.on('exit', function() {
|
||||
assert.match(server_response, quit);
|
||||
|
||||
assert.strictEqual(client_got_eof, true);
|
||||
assert.strictEqual(server.close(), server);
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user