Skip to content
This repository was archived by the owner on Nov 2, 2023. It is now read-only.

Commit 56a95df

Browse files
committed
add cancel
1 parent 211bc18 commit 56a95df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/internal/highway.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,8 +258,10 @@ export function highwayHttpUpload(this: Client, readable: stream.Readable, obj:
258258
readable.on("err", reject)
259259
.on("end", () => {
260260
Promise.all(tasks).then(resolve).catch(err => {
261-
if (err instanceof axios.Cancel === false)
261+
if (err instanceof axios.Cancel === false) {
262+
cancels.forEach(c => c.cancel())
262263
reject(err)
264+
}
263265
resolve(undefined)
264266
})
265267
})

0 commit comments

Comments
 (0)