File tree 2 files changed +2
-8
lines changed
2 files changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -77,12 +77,6 @@ class RequestHandler extends AsyncResource {
77
77
} else if ( this . abort ) {
78
78
this . abort ( this . reason )
79
79
}
80
-
81
- if ( this . removeAbortListener ) {
82
- this . res ?. off ( 'close' , this . removeAbortListener )
83
- this . removeAbortListener ( )
84
- this . removeAbortListener = null
85
- }
86
80
} )
87
81
}
88
82
}
@@ -127,6 +121,7 @@ class RequestHandler extends AsyncResource {
127
121
128
122
if ( this . removeAbortListener ) {
129
123
res . on ( 'close' , this . removeAbortListener )
124
+ this . removeAbortListener = null
130
125
}
131
126
132
127
this . callback = null
@@ -183,7 +178,6 @@ class RequestHandler extends AsyncResource {
183
178
}
184
179
185
180
if ( this . removeAbortListener ) {
186
- res ?. off ( 'close' , this . removeAbortListener )
187
181
this . removeAbortListener ( )
188
182
this . removeAbortListener = null
189
183
}
Original file line number Diff line number Diff line change @@ -518,7 +518,7 @@ function addAbortListener (signal, listener) {
518
518
signal . addEventListener ( 'abort' , listener , { once : true } )
519
519
return ( ) => signal . removeEventListener ( 'abort' , listener )
520
520
}
521
- signal . addListener ( 'abort' , listener )
521
+ signal . once ( 'abort' , listener )
522
522
return ( ) => signal . removeListener ( 'abort' , listener )
523
523
}
524
524
You can’t perform that action at this time.
0 commit comments