diff --git a/lib/request-wrapper.ts b/lib/request-wrapper.ts index 8b4e561f1..f3aad5950 100644 --- a/lib/request-wrapper.ts +++ b/lib/request-wrapper.ts @@ -51,6 +51,7 @@ export class RequestWrapper { // defaults here const axiosConfig: AxiosRequestConfig = { maxContentLength: Infinity, + maxBodyLength: Infinity, headers: { post: { 'Content-Type': 'application/json', diff --git a/test/unit/request-wrapper.test.js b/test/unit/request-wrapper.test.js index d49be3a4b..7ddfbc068 100644 --- a/test/unit/request-wrapper.test.js +++ b/test/unit/request-wrapper.test.js @@ -66,6 +66,7 @@ describe('RequestWrapper constructor', () => { // axios instance with it const createdAxiosConfig = axios.default.create.mock.calls[0][0]; expect(createdAxiosConfig.maxContentLength).toBe(Infinity); + expect(createdAxiosConfig.maxBodyLength).toBe(Infinity); expect(createdAxiosConfig.headers).toBeDefined(); expect(createdAxiosConfig.headers.post).toBeDefined(); expect(createdAxiosConfig.headers.put).toBeDefined(); @@ -78,10 +79,12 @@ describe('RequestWrapper constructor', () => { it('should override the defaults with user-provided input', () => { const unused = new RequestWrapper({ maxContentLength: 100, + maxBodyLength: 200, }); const createdAxiosConfig = axios.default.create.mock.calls[0][0]; expect(createdAxiosConfig.maxContentLength).toBe(100); + expect(createdAxiosConfig.maxBodyLength).toBe(200); }); it('creates a custom https agent when disableSslVerification is true', () => {