Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/libraries/core/src/client/http-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,9 @@ export async function makeFetchCall(
let maxTimeout = 2000;
let factor = 1.2;

const actionHeader =
config.method === 'POST' ? { 'x-client-action-id': crypto.randomUUID() } : undefined;

if (config.retry !== false) {
retries = config.retry?.retries ?? 5;
minTimeout = config.retry?.minTimeout ?? 200;
Expand All @@ -117,6 +120,8 @@ export async function makeFetchCall(
body: config.body,
headers: {
'x-request-id': requestId,
'x-client-timestamp': new Date().toISOString(),
...actionHeader,
...config.headers,
},
signal,
Expand Down
Loading