From b05f3ad4b0aab9b90dc40b62066a4c10d666539a Mon Sep 17 00:00:00 2001 From: Kadhirravan R <53949365+kadhirr@users.noreply.github.com> Date: Mon, 16 Dec 2024 10:34:45 +0530 Subject: [PATCH] fix: pass abort reason to early abort --- source/core/Ky.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/core/Ky.ts b/source/core/Ky.ts index 11c601e9..5218d6c7 100644 --- a/source/core/Ky.ts +++ b/source/core/Ky.ts @@ -164,7 +164,7 @@ export class Ky { this.abortController = new globalThis.AbortController(); const originalSignal = this._options.signal ?? (this._input as Request).signal; if (originalSignal?.aborted) { - this.abortController.abort(); + this.abortController.abort(originalSignal?.reason); } originalSignal?.addEventListener('abort', () => {