Commit e0e39c6 1 parent fadcee7 commit e0e39c6 Copy full SHA for e0e39c6
File tree 1 file changed +9
-8
lines changed
1 file changed +9
-8
lines changed Original file line number Diff line number Diff line change 20
20
// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
21
22
22
'use strict' ;
23
- require ( '../common' ) ;
23
+ const common = require ( '../common' ) ;
24
24
const assert = require ( 'assert' ) ;
25
25
26
26
const http = require ( 'http' ) ;
@@ -54,13 +54,14 @@ server.listen(0, function() {
54
54
res . setEncoding ( 'ascii' ) ;
55
55
res . on ( 'data' , function ( chunk ) {
56
56
response += chunk ;
57
+ if ( response ?. toString ( ) === 'beep boop\n' ) {
58
+ setTimeout ( function ( ) {
59
+ // The socket should be closed immediately, with no keep-alive, because
60
+ // no content-length or transfer-encoding are used:
61
+ assert . strictEqual ( res . socket . closed , true ) ;
62
+ server . close ( ) ;
63
+ } , common . platformTimeout ( 15 ) ) ;
64
+ }
57
65
} ) ;
58
-
59
- setTimeout ( function ( ) {
60
- // The socket should be closed immediately, with no keep-alive, because
61
- // no content-length or transfer-encoding are used:
62
- assert . strictEqual ( res . socket . closed , true ) ;
63
- server . close ( ) ;
64
- } , 10 ) ;
65
66
} ) ;
66
67
} ) ;
You can’t perform that action at this time.
0 commit comments