Skip to content

Commit 368f071

Browse files
committed
fixup
1 parent 85d7eed commit 368f071

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

lib/api/api-request.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,12 @@ class RequestHandler extends AsyncResource {
6565
} else if (signal) {
6666
this.removeAbortListener = util.addAbortListener(this.signal, () => {
6767
this.reason = this.signal.reason ?? new RequestAbortedError()
68-
} else {
69-
this.removeAbortListener = util.addAbortListener(this.signal, () => {
70-
this.reason = this.signal.reason ?? new RequestAbortedError()
71-
if (this.res) {
72-
util.destroy(this.res, this.reason)
73-
} else if (this.abort) {
74-
this.abort(this.reason)
75-
}
76-
})
77-
}
68+
if (this.res) {
69+
util.destroy(this.res, this.reason)
70+
} else if (this.abort) {
71+
this.abort(this.reason)
72+
}
73+
})
7874
}
7975
}
8076

0 commit comments

Comments
 (0)