File tree Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Expand file tree Collapse file tree 2 files changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ import {
20
20
responseTypes ,
21
21
stop ,
22
22
supportsAbortController ,
23
+ supportsAbortSignal ,
23
24
supportsFormData ,
24
25
supportsResponseStreams ,
25
26
supportsRequestStreams ,
@@ -168,7 +169,7 @@ export class Ky {
168
169
this . _input = this . _options . prefixUrl + this . _input ;
169
170
}
170
171
171
- if ( supportsAbortController ) {
172
+ if ( supportsAbortController && supportsAbortSignal ) {
172
173
const originalSignal = this . _options . signal ?? ( this . _input as Request ) . signal ;
173
174
this . abortController = new globalThis . AbortController ( ) ;
174
175
this . _options . signal = originalSignal ? AbortSignal . any ( [ originalSignal , this . abortController . signal ] ) : this . abortController . signal ;
Original file line number Diff line number Diff line change @@ -33,6 +33,7 @@ export const supportsRequestStreams = (() => {
33
33
} ) ( ) ;
34
34
35
35
export const supportsAbortController = typeof globalThis . AbortController === 'function' ;
36
+ export const supportsAbortSignal = typeof globalThis . AbortSignal === 'function' && typeof globalThis . AbortSignal . any === 'function' ;
36
37
export const supportsResponseStreams = typeof globalThis . ReadableStream === 'function' ;
37
38
export const supportsFormData = typeof globalThis . FormData === 'function' ;
38
39
You can’t perform that action at this time.
0 commit comments