File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 1
1
'use strict' ;
2
2
const common = require ( '../common' ) ;
3
- var http = require ( 'http' ) ;
3
+ const http = require ( 'http' ) ;
4
4
5
- var server = http . Server ( function ( req , res ) {
5
+ const server = http . Server ( function ( req , res ) {
6
6
res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
7
7
res . end ( 'Hello World\n' ) ;
8
8
server . close ( ) ;
9
9
} ) ;
10
10
11
11
server . listen ( 0 , common . mustCall ( function ( ) {
12
- var opts = {
12
+ const opts = {
13
13
port : this . address ( ) . port ,
14
14
headers : { connection : 'close' }
15
15
} ;
16
16
17
17
http . get ( opts , common . mustCall ( function ( res ) {
18
- res . on ( 'data' , common . mustCall ( function ( chunk ) {
18
+ res . on ( 'data' , common . mustCall ( function ( ) {
19
19
res . pause ( ) ;
20
- setTimeout ( function ( ) {
20
+ setImmediate ( function ( ) {
21
21
res . resume ( ) ;
22
22
} ) ;
23
23
} ) ) ;
You can’t perform that action at this time.
0 commit comments