File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change @@ -9,21 +9,23 @@ const https = require('https');
9
9
const assert = require ( 'assert' ) ;
10
10
11
11
{
12
- https . createServer ( {
12
+ const server = https . createServer ( {
13
13
cert : fixtures . readKey ( 'agent1-cert.pem' ) ,
14
14
key : fixtures . readKey ( 'agent1-key.pem' ) ,
15
- } , common . mustCall ( function ( req , res ) {
16
- this . close ( ) ;
15
+ } , common . mustCall ( ( req , res ) => {
16
+ server . close ( ) ;
17
17
res . end ( ) ;
18
- } ) ) . listen ( 0 , 'localhost' , common . mustCall ( function ( ) {
19
- const port = this . address ( ) . port ;
18
+ } ) ) ;
19
+
20
+ server . listen ( 0 , 'localhost' , common . mustCall ( ( ) => {
21
+ const port = server . address ( ) . port ;
20
22
const req = https . get ( {
21
23
host : 'localhost' ,
22
24
pathname : '/' ,
23
25
port,
24
26
family : 4 ,
25
27
localPort : common . PORT ,
26
- rejectUnauthorized : false
28
+ rejectUnauthorized : false ,
27
29
} , common . mustCall ( ( ) => {
28
30
assert . strictEqual ( req . socket . localPort , common . PORT ) ;
29
31
assert . strictEqual ( req . socket . remotePort , port ) ;
You can’t perform that action at this time.
0 commit comments