mirror of
https://github.com/tenrok/axios.git
synced 2026-06-20 20:00:40 +03:00
Fixed a regression bug with unsubscribing from cancel token; (#4819)
Reverts #4795; Co-authored-by: Jay <jasonsaayman@gmail.com>
This commit is contained in:
@@ -100,7 +100,6 @@ function setProxy(options, configProxy, location) {
|
||||
/*eslint consistent-return:0*/
|
||||
export default function httpAdapter(config) {
|
||||
return new Promise(function dispatchHttpRequest(resolvePromise, rejectPromise) {
|
||||
let onCanceled;
|
||||
let data = config.data;
|
||||
const responseType = config.responseType;
|
||||
const responseEncoding = config.responseEncoding;
|
||||
@@ -118,11 +117,11 @@ export default function httpAdapter(config) {
|
||||
isFinished = true;
|
||||
|
||||
if (config.cancelToken) {
|
||||
config.cancelToken.unsubscribe(onCanceled);
|
||||
config.cancelToken.unsubscribe(abort);
|
||||
}
|
||||
|
||||
if (config.signal) {
|
||||
config.signal.removeEventListener('abort', onCanceled);
|
||||
config.signal.removeEventListener('abort', abort);
|
||||
}
|
||||
|
||||
emitter.removeAllListeners();
|
||||
|
||||
Reference in New Issue
Block a user