@@ -27,7 +27,7 @@ const url = require('url');
27
27
28
28
const expectedRequests = [ '/hello' , '/there' , '/world' ] ;
29
29
30
- const server = http . Server ( common . mustCall ( function ( req , res ) {
30
+ const server = http . Server ( common . mustCall ( ( req , res ) => {
31
31
assert . strictEqual ( expectedRequests . shift ( ) , req . url ) ;
32
32
33
33
switch ( req . url ) {
@@ -50,9 +50,9 @@ const server = http.Server(common.mustCall(function(req, res) {
50
50
}
51
51
52
52
if ( expectedRequests . length === 0 )
53
- this . close ( ) ;
53
+ server . close ( ) ;
54
54
55
- req . on ( 'end' , function ( ) {
55
+ req . on ( 'end' , ( ) => {
56
56
res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
57
57
res . write ( `The path was ${ url . parse ( req . url ) . pathname } ` ) ;
58
58
res . end ( ) ;
@@ -61,10 +61,10 @@ const server = http.Server(common.mustCall(function(req, res) {
61
61
} , 3 ) ) ;
62
62
server . listen ( 0 ) ;
63
63
64
- server . on ( 'listening' , function ( ) {
65
- const agent = new http . Agent ( { port : this . address ( ) . port , maxSockets : 1 } ) ;
64
+ server . on ( 'listening' , ( ) => {
65
+ const agent = new http . Agent ( { port : server . address ( ) . port , maxSockets : 1 } ) ;
66
66
const req = http . get ( {
67
- port : this . address ( ) . port ,
67
+ port : server . address ( ) . port ,
68
68
path : '/hello' ,
69
69
headers : {
70
70
Accept : '*/*' ,
0 commit comments