@@ -27,7 +27,7 @@ const url = require('url');
2727
2828const expectedRequests = [ '/hello' , '/there' , '/world' ] ;
2929
30- const server = http . Server ( common . mustCall ( function ( req , res ) {
30+ const server = http . Server ( common . mustCall ( ( req , res ) => {
3131 assert . strictEqual ( expectedRequests . shift ( ) , req . url ) ;
3232
3333 switch ( req . url ) {
@@ -50,9 +50,9 @@ const server = http.Server(common.mustCall(function(req, res) {
5050 }
5151
5252 if ( expectedRequests . length === 0 )
53- this . close ( ) ;
53+ server . close ( ) ;
5454
55- req . on ( 'end' , function ( ) {
55+ req . on ( 'end' , ( ) => {
5656 res . writeHead ( 200 , { 'Content-Type' : 'text/plain' } ) ;
5757 res . write ( `The path was ${ url . parse ( req . url ) . pathname } ` ) ;
5858 res . end ( ) ;
@@ -61,10 +61,10 @@ const server = http.Server(common.mustCall(function(req, res) {
6161} , 3 ) ) ;
6262server . listen ( 0 ) ;
6363
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 } ) ;
6666 const req = http . get ( {
67- port : this . address ( ) . port ,
67+ port : server . address ( ) . port ,
6868 path : '/hello' ,
6969 headers : {
7070 Accept : '*/*' ,
0 commit comments