We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 02921e1 commit 33caf96Copy full SHA for 33caf96
test/parallel/test-http-remove-connection-header-persists-connection.js
@@ -50,9 +50,10 @@ function makeHttp10Request(cb) {
50
'\r\n');
51
socket.resume(); // Ignore the response itself
52
53
- setTimeout(function() {
54
- cb(socket);
55
- }, common.platformTimeout(50));
+ // Invoke the callback when the socket closes. The server should close it
+ // immediately after sending the response.
+ socket.on('close', cb);
56
+ // If the socket is not closed, the test will fail with a timeout.
57
});
58
}
59
@@ -63,8 +64,6 @@ server.listen(0, function() {
63
64
assert.strictEqual(firstSocket, secondSocket);
65
66
makeHttp10Request(function(socket) {
- // The server should have immediately closed the HTTP/1.0 socket:
67
- assert.strictEqual(socket.closed, true);
68
server.close();
69
70
0 commit comments