Skip to content

Commit ee36919

Browse files
chore(client): minor internal fixes
1 parent 37d8e14 commit ee36919

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/core.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -296,10 +296,10 @@ export abstract class APIClient {
296296
}
297297

298298
buildRequest<Req>(
299-
options: FinalRequestOptions<Req>,
299+
inputOptions: FinalRequestOptions<Req>,
300300
{ retryCount = 0 }: { retryCount?: number } = {},
301301
): { req: RequestInit; url: string; timeout: number } {
302-
options = { ...options };
302+
const options = { ...inputOptions };
303303
const { method, path, query, headers: headers = {} } = options;
304304

305305
const body =
@@ -327,8 +327,8 @@ export abstract class APIClient {
327327
}
328328

329329
if (this.idempotencyHeader && method !== 'get') {
330-
if (!options.idempotencyKey) options.idempotencyKey = this.defaultIdempotencyKey();
331-
headers[this.idempotencyHeader] = options.idempotencyKey;
330+
if (!inputOptions.idempotencyKey) inputOptions.idempotencyKey = this.defaultIdempotencyKey();
331+
headers[this.idempotencyHeader] = inputOptions.idempotencyKey;
332332
}
333333

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

0 commit comments

Comments
 (0)