diff --git a/x-pack/plugins/actions/server/lib/axios_utils.test.ts b/x-pack/plugins/actions/server/lib/axios_utils.test.ts index 1f94e610f60bf..7423042e68228 100644 --- a/x-pack/plugins/actions/server/lib/axios_utils.test.ts +++ b/x-pack/plugins/actions/server/lib/axios_utils.test.ts @@ -66,7 +66,6 @@ describe('request', () => { expect(axiosMock).toHaveBeenCalledWith('/test', { method: 'get', - data: {}, httpAgent: undefined, httpsAgent: expect.any(HttpsAgent), proxy: false, @@ -100,7 +99,6 @@ describe('request', () => { expect(axiosMock).toHaveBeenCalledWith(TestUrl, { method: 'get', - data: {}, httpAgent, httpsAgent, proxy: false, @@ -132,7 +130,6 @@ describe('request', () => { expect(axiosMock).toHaveBeenCalledWith('https://testProxy', { method: 'get', - data: {}, httpAgent: undefined, httpsAgent: expect.any(HttpsAgent), proxy: false, diff --git a/x-pack/plugins/actions/server/lib/axios_utils.ts b/x-pack/plugins/actions/server/lib/axios_utils.ts index 181893db15f0c..163eac3eada2b 100644 --- a/x-pack/plugins/actions/server/lib/axios_utils.ts +++ b/x-pack/plugins/actions/server/lib/axios_utils.ts @@ -51,7 +51,7 @@ export const request = async ({ ...config, method, headers, - data: data ?? {}, + ...(data ? { data } : {}), // use httpAgent and httpsAgent and set axios proxy: false, to be able to handle fail on invalid certs httpAgent, httpsAgent,