Skip to content

Commit

Permalink
add signal for WebDAVMethodOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
wenerme committed Dec 22, 2021
1 parent 32b9f0b commit 36abcba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
3 changes: 3 additions & 0 deletions source/request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ export function prepareRequestOptions(
if (typeof userOptions.data !== "undefined") {
finalOptions.data = userOptions.data;
}
if (userOptions.signal) {
finalOptions.signal = userOptions.signal;
}
if (context.httpAgent) {
finalOptions.httpAgent = context.httpAgent;
}
Expand Down
2 changes: 2 additions & 0 deletions source/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ interface RequestOptionsBase {
url?: string;
validateStatus?: (status: number) => boolean;
withCredentials?: boolean;
signal?: AbortSignal;
}

export interface RequestOptionsCustom extends RequestOptionsBase {}
Expand Down Expand Up @@ -285,4 +286,5 @@ export interface WebDAVClientOptions {
export interface WebDAVMethodOptions {
data?: RequestDataPayload;
headers?: Headers;
signal?: AbortSignal;
}

0 comments on commit 36abcba

Please sign in to comment.