@@ -57,12 +57,12 @@ const proxy = net.createServer((clientSocket) => {
5757 clientSocket . on ( 'data' , ( chunk ) => {
5858 if ( ! serverSocket ) {
5959 // Verify the CONNECT request
60- assert . strictEqual ( `CONNECT localhost:${ server . address ( ) . port } ` +
60+ assert . strictEqual ( chunk . toString ( ) ,
61+ `CONNECT localhost:${ server . address ( ) . port } ` +
6162 'HTTP/1.1\r\n' +
6263 'Proxy-Connections: keep-alive\r\n' +
6364 `Host: localhost:${ proxy . address ( ) . port } \r\n` +
64- 'Connection: close\r\n\r\n' ,
65- chunk . toString ( ) ) ;
65+ 'Connection: close\r\n\r\n' ) ;
6666
6767 console . log ( 'PROXY: got CONNECT request' ) ;
6868 console . log ( 'PROXY: creating a tunnel' ) ;
@@ -126,7 +126,7 @@ proxy.listen(0, common.mustCall(() => {
126126 }
127127
128128 function onConnect ( res , socket , header ) {
129- assert . strictEqual ( 200 , res . statusCode ) ;
129+ assert . strictEqual ( res . statusCode , 200 ) ;
130130 console . log ( 'CLIENT: got CONNECT response' ) ;
131131
132132 // detach the socket
@@ -149,10 +149,10 @@ proxy.listen(0, common.mustCall(() => {
149149 agent : false ,
150150 rejectUnauthorized : false
151151 } , ( res ) => {
152- assert . strictEqual ( 200 , res . statusCode ) ;
152+ assert . strictEqual ( res . statusCode , 200 ) ;
153153
154154 res . on ( 'data' , common . mustCall ( ( chunk ) => {
155- assert . strictEqual ( 'hello world\n' , chunk . toString ( ) ) ;
155+ assert . strictEqual ( chunk . toString ( ) , 'hello world\n' ) ;
156156 console . log ( 'CLIENT: got HTTPS response' ) ;
157157 gotRequest = true ;
158158 } ) ) ;
0 commit comments