Skip to content

Commit

Permalink
[Actions] Adjust axios payload for APIs that do not want data sent (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
stephmilovic authored Sep 6, 2023
1 parent b48dc84 commit d6a2bd7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions x-pack/plugins/actions/server/lib/axios_utils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,6 @@ describe('request', () => {

expect(axiosMock).toHaveBeenCalledWith('/test', {
method: 'get',
data: {},
httpAgent: undefined,
httpsAgent: expect.any(HttpsAgent),
proxy: false,
Expand Down Expand Up @@ -100,7 +99,6 @@ describe('request', () => {

expect(axiosMock).toHaveBeenCalledWith(TestUrl, {
method: 'get',
data: {},
httpAgent,
httpsAgent,
proxy: false,
Expand Down Expand Up @@ -132,7 +130,6 @@ describe('request', () => {

expect(axiosMock).toHaveBeenCalledWith('https://testProxy', {
method: 'get',
data: {},
httpAgent: undefined,
httpsAgent: expect.any(HttpsAgent),
proxy: false,
Expand Down
2 changes: 1 addition & 1 deletion x-pack/plugins/actions/server/lib/axios_utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export const request = async <T = unknown>({
...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,
Expand Down

0 comments on commit d6a2bd7

Please sign in to comment.