Commit 5415911 1 parent fd32a55 commit 5415911 Copy full SHA for 5415911
File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,8 @@ let deprecatedInterceptorWarned = false
63
63
64
64
const kClosedResolve = Symbol ( 'kClosedResolve' )
65
65
66
+ const noop = ( ) => { }
67
+
66
68
function getPipelining ( client ) {
67
69
return client [ kPipelining ] ?? client [ kHTTPContext ] ?. defaultPipelining ?? 1
68
70
}
@@ -442,7 +444,7 @@ async function connect (client) {
442
444
} )
443
445
444
446
if ( client . destroyed ) {
445
- util . destroy ( socket . on ( 'error' , ( ) => { } ) , new ClientDestroyedError ( ) )
447
+ util . destroy ( socket . on ( 'error' , noop ) , new ClientDestroyedError ( ) )
446
448
return
447
449
}
448
450
@@ -453,7 +455,7 @@ async function connect (client) {
453
455
? await connectH2 ( client , socket )
454
456
: await connectH1 ( client , socket )
455
457
} catch ( err ) {
456
- socket . destroy ( ) . on ( 'error' , ( ) => { } )
458
+ socket . destroy ( ) . on ( 'error' , noop )
457
459
throw err
458
460
}
459
461
Original file line number Diff line number Diff line change @@ -23,6 +23,8 @@ function defaultFactory (origin, opts) {
23
23
return new Pool ( origin , opts )
24
24
}
25
25
26
+ const noop = ( ) => { }
27
+
26
28
class ProxyAgent extends DispatcherBase {
27
29
constructor ( opts ) {
28
30
super ( )
@@ -81,7 +83,7 @@ class ProxyAgent extends DispatcherBase {
81
83
servername : this [ kProxyTls ] ?. servername || proxyHostname
82
84
} )
83
85
if ( statusCode !== 200 ) {
84
- socket . on ( 'error' , ( ) => { } ) . destroy ( )
86
+ socket . on ( 'error' , noop ) . destroy ( )
85
87
callback ( new RequestAbortedError ( `Proxy response (${ statusCode } ) !== 200 when HTTP Tunneling` ) )
86
88
}
87
89
if ( opts . protocol !== 'https:' ) {
You can’t perform that action at this time.
0 commit comments