File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+ 'use strict' ; 
2+ 
3+ const  common  =  require ( '../common' ) ; 
4+ const  assert  =  require ( 'assert' ) ; 
5+ const  http  =  require ( 'http' ) ; 
6+ 
7+ const  server  =  http . createServer ( common . mustCall ( function ( req ,  res )  { 
8+   req . once ( 'data' ,  common . mustCall ( ( )  =>  { 
9+     req . pause ( ) ; 
10+     res . writeHead ( 200 ) ; 
11+     res . end ( ) ; 
12+     res . on ( 'finish' ,  common . mustCall ( ( )  =>  { 
13+       assert ( ! req . _dumped ) ; 
14+     } ) ) ; 
15+   } ) ) ; 
16+ } ) ) ; 
17+ server . listen ( 0 ) ; 
18+ 
19+ server . on ( 'listening' ,  common . mustCall ( function ( )  { 
20+   const  req  =  http . request ( { 
21+     port : this . address ( ) . port , 
22+     method : 'POST' , 
23+     path : '/' 
24+   } ,  common . mustCall ( function ( res )  { 
25+     assert . strictEqual ( res . statusCode ,  200 ) ; 
26+     res . resume ( ) ; 
27+     res . on ( 'end' ,  common . mustCall ( ( )  =>  { 
28+       server . close ( ) ; 
29+     } ) ) ; 
30+   } ) ) ; 
31+ 
32+   req . end ( Buffer . allocUnsafe ( 1024 ) ) ; 
33+ } ) ) ; 
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments