From 5dc5ef6baaeacc6b6b5975b06f867bd547224b97 Mon Sep 17 00:00:00 2001 From: Aayush Shah Date: Tue, 19 Nov 2024 01:25:39 -0500 Subject: [PATCH] stop messing up API client headers in requests to backend (#28) --- src/main.ts | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/src/main.ts b/src/main.ts index ddf8b3f..92c5fad 100644 --- a/src/main.ts +++ b/src/main.ts @@ -124,18 +124,10 @@ async function postWithRetryToBlacksmithAPI(client: AxiosInstance, url: string, for (let attempt = 1; attempt <= maxRetries; attempt++) { try { - const headers = { - ...client.defaults.headers.common, - Accept: 'application/json', - 'Content-Type': 'application/json' - }; - core.debug(`Making POST request to ${url}`); - core.debug(`Request headers: ${JSON.stringify(headers, null, 2)}`); + core.debug(`Request headers: ${JSON.stringify(client.defaults.headers, null, 2)}`); - return await client.post(url, JSON.stringify(requestOptions), { - headers - }); + return await client.post(url, requestOptions); } catch (error) { if (attempt === maxRetries || !retryCondition(error as AxiosError)) { throw error;