We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90659bc commit 2f9c8d9Copy full SHA for 2f9c8d9
test/parallel/test-http-pause-resume-one-end.js
@@ -1,23 +1,23 @@
1
'use strict';
2
const common = require('../common');
3
-var http = require('http');
+const http = require('http');
4
5
-var server = http.Server(function(req, res) {
+const server = http.Server(function(req, res) {
6
res.writeHead(200, {'Content-Type': 'text/plain'});
7
res.end('Hello World\n');
8
server.close();
9
});
10
11
server.listen(0, common.mustCall(function() {
12
- var opts = {
+ const opts = {
13
port: this.address().port,
14
headers: { connection: 'close' }
15
};
16
17
http.get(opts, common.mustCall(function(res) {
18
- res.on('data', common.mustCall(function(chunk) {
+ res.on('data', common.mustCall(function() {
19
res.pause();
20
- setTimeout(function() {
+ setImmediate(function() {
21
res.resume();
22
23
}));
0 commit comments