@@ -10,11 +10,11 @@ const bodySent = 'This is my request';
1010function assertResponse ( headers , body , expectClosed ) {
1111 if ( expectClosed ) {
1212 assert . match ( headers , / C o n n e c t i o n : c l o s e \r \n / m) ;
13- assert . strictEqual ( headers . search ( / K e e p - A l i v e : t i m e o u t = 5 , m a x = 3 \r \n / m) , - 1 ) ;
13+ assert . strictEqual ( headers . search ( / K e e p - A l i v e : t i m e o u t = 6 5 , m a x = 3 \r \n / m) , - 1 ) ;
1414 assert . match ( body , / H e l l o W o r l d ! / m) ;
1515 } else {
1616 assert . match ( headers , / C o n n e c t i o n : k e e p - a l i v e \r \n / m) ;
17- assert . match ( headers , / K e e p - A l i v e : t i m e o u t = 5 , m a x = 3 \r \n / m) ;
17+ assert . match ( headers , / K e e p - A l i v e : t i m e o u t = 6 5 , m a x = 3 \r \n / m) ;
1818 assert . match ( body , / H e l l o W o r l d ! / m) ;
1919 }
2020}
@@ -46,6 +46,7 @@ const server = http.createServer((req, res) => {
4646 } ) ;
4747} ) ;
4848
49+ server . keepAliveTimeout = 65 * 1000 ; // 65 seconds
4950server . maxRequestsPerSocket = 3 ;
5051
5152server . listen ( 0 , common . mustCall ( ( res ) => {
@@ -76,7 +77,7 @@ server.listen(0, common.mustCall((res) => {
7677
7778 assert . match ( responseParts [ 6 ] , / H T T P \/ 1 \. 1 5 0 3 S e r v i c e U n a v a i l a b l e / m) ;
7879 assert . match ( responseParts [ 6 ] , / C o n n e c t i o n : c l o s e \r \n / m) ;
79- assert . strictEqual ( responseParts [ 6 ] . search ( / K e e p - A l i v e : t i m e o u t = 5 \r \n / m) , - 1 ) ;
80+ assert . strictEqual ( responseParts [ 6 ] . search ( / K e e p - A l i v e : t i m e o u t = 6 5 \r \n / m) , - 1 ) ;
8081 assert . strictEqual ( responseParts [ 7 ] . search ( / H e l l o W o r l d ! / m) , - 1 ) ;
8182
8283 socket . end ( ) ;
0 commit comments