Skip to content

Commit 4b9adb9

Browse files
authored
Merge pull request #630 from postmanlabs/fix/AxiosMaxBodyLength
Update axios.js
2 parents 9746488 + c7cab16 commit 4b9adb9

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

codegens/nodejs-axios/lib/axios.js

+1
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ function makeSnippet (request, indentString, options) {
8989
snippet += dataSnippet + '\n';
9090

9191
configArray.push(indentString + `method: '${request.method.toLowerCase()}'`);
92+
configArray.push('maxBodyLength: Infinity');
9293
configArray.push(indentString + `url: '${sanitize(request.url.toString())}'`);
9394

9495
headers = parseRequest.parseHeader(request, indentString);

codegens/nodejs-axios/test/unit/snippet.test.js

+15
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,21 @@ describe('nodejs-axios convert function', function () {
424424
});
425425
});
426426

427+
it('should return snippet with maxBodyLength property as "Infinity"', function () {
428+
request = new sdk.Request(mainCollection.item[0].request);
429+
options = {
430+
requestTimeout: 1000
431+
};
432+
convert(request, options, function (error, snippet) {
433+
if (error) {
434+
expect.fail(null, null, error);
435+
return;
436+
}
437+
expect(snippet).to.be.a('string');
438+
expect(snippet).to.include('maxBodyLength: Infinity');
439+
});
440+
});
441+
427442
describe('getOptions function', function () {
428443

429444
it('should return an array of specific options', function () {

0 commit comments

Comments
 (0)