Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ec17fd7

Browse filesBrowse files
kylo5abymarco-ippolito
authored andcommitted
http: fix close return value mismatch between doc and implementation
PR-URL: #51797 Fixes: #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>
1 parent 5f94912 commit ec17fd7
Copy full SHA for ec17fd7

File tree

Expand file treeCollapse file tree

3 files changed

+3
-0
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

3 files changed

+3
-0
lines changed
Open diff view settings
Collapse file

‎lib/_http_server.js‎

Copy file name to clipboardExpand all lines: lib/_http_server.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,7 @@ ObjectSetPrototypeOf(Server, net.Server);
561561
Server.prototype.close = function() {
562562
httpServerPreClose(this);
563563
ReflectApply(net.Server.prototype.close, this, arguments);
564+
return this;
564565
};
565566

566567
Server.prototype[SymbolAsyncDispose] = async function() {
Collapse file

‎lib/https.js‎

Copy file name to clipboardExpand all lines: lib/https.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ Server.prototype.setTimeout = HttpServer.prototype.setTimeout;
111111
Server.prototype.close = function() {
112112
httpServerPreClose(this);
113113
ReflectApply(tls.Server.prototype.close, this, arguments);
114+
return this;
114115
};
115116

116117
Server.prototype[SymbolAsyncDispose] = async function() {
Collapse file

‎test/parallel/test-http-server.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-server.js
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,4 +139,5 @@ process.on('exit', function() {
139139
assert.match(server_response, quit);
140140

141141
assert.strictEqual(client_got_eof, true);
142+
assert.strictEqual(server.close(), server);
142143
});

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.