You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since node version 14 the methodabort() within class http.ClientRequest is deprecated. The associated eventabort has also been deprecated in the meantime.
According to the docs, one should use destroy() instead, to abort a request prematurely.
However, in contrast to abort(), the method destroy() is unfortunately not overridden and properly implemented in RedirectableRequest, which means that the _currentRequest of the redirecting chain is not terminated.
Adding the following lines as a quick fix solves the problem, but should certainly be implemented in a better way:
Since node version 14 the method
abort()
within classhttp.ClientRequest
is deprecated. The associated eventabort
has also been deprecated in the meantime.According to the docs, one should use
destroy()
instead, to abort a request prematurely.However, in contrast to
abort()
, the methoddestroy()
is unfortunately not overridden and properly implemented inRedirectableRequest
, which means that the_currentRequest
of the redirecting chain is not terminated.Adding the following lines as a quick fix solves the problem, but should certainly be implemented in a better way:
I just call
this.abort()
, to:_currentRequest
. -> It would be better to calldestroy()
on the_currentRequest
.abort
event. -> Should be removed but is necessary in the quick fix so that hereclearTimer()
is called.I'm using node v18 and the http client Axios, which in turn uses follow-redirects, which is how I noticed the problem.
The text was updated successfully, but these errors were encountered: