Skip to content

Commit 6558b7c

Browse files
chore(client): minor internal fixes
1 parent 77fc77f commit 6558b7c

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -331,10 +331,10 @@ export abstract class APIClient {
331331
}
332332

333333
buildRequest<Req>(
334-
options: FinalRequestOptions<Req>,
334+
inputOptions: FinalRequestOptions<Req>,
335335
{ retryCount = 0 }: { retryCount?: number } = {},
336336
): { req: RequestInit; url: string; timeout: number } {
337-
options = { ...options };
337+
const options = { ...inputOptions };
338338
const { method, path, query, headers: headers = {} } = options;
339339

340340
const body =
@@ -362,8 +362,8 @@ export abstract class APIClient {
362362
}
363363

364364
if (this.idempotencyHeader && method !== 'get') {
365-
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
366-
headers[this.idempotencyHeader] = options.idempotencyKey;
365+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
366+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
367367
}
368368

369369
const reqHeaders = this.buildHeaders({ options, headers, contentLength, retryCount });

0 commit comments

Comments
 (0)