Skip to content

Commit 251206a

Browse files
committed
abort early
1 parent 251205a commit 251206a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/@uppy/utils/src/fetcher.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -147,13 +147,14 @@ export function fetcher(
147147

148148
signal?.addEventListener('abort', abort)
149149

150-
await onBeforeRequest(xhr, retryCount)
151-
xhr.send(body)
152-
153150
if (signal?.aborted) {
154151
// in case the signal was already aborted
155152
abort()
153+
return
156154
}
155+
156+
await onBeforeRequest(xhr, retryCount)
157+
xhr.send(body)
157158
})
158159
}
159160

0 commit comments

Comments
 (0)