Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update v1.x branch with proposed release changes #4750

Merged
merged 24 commits into from
May 28, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
24f22b2
Fixing proxy beforeRedirect regression (#4708)
mbargiel May 16, 2022
e762cf7
Adding Canceler parameters config and request (#4711)
aweikalee May 16, 2022
c05ad48
Fixed `toFormData` regression bug (unreleased) with Array-like object…
DigitalBrainJS May 16, 2022
9be61dc
Allow webpack users to overwrite buildins (#4715)
KyorCode May 16, 2022
65b9295
Fixed `AxiosError` status code type; (#4717)
DigitalBrainJS May 16, 2022
d60d684
Fixed `AxiosError` stack capturing; (#4718)
DigitalBrainJS May 16, 2022
ed0ba0f
allow type definition for axios instance methods (#4224)
jelleschutter May 16, 2022
ee51e68
add `string[]` to `AxiosRequestHeaders` type (#4322)
estarossa0 May 16, 2022
e6f9026
Fixing AxiosRequestHeaders typings (#4334)
turisap May 16, 2022
bd39124
Added the ability for the `url-encoded-form` serializer to respect th…
DigitalBrainJS May 17, 2022
bd58c4e
Updated eslint config; (#4722)
DigitalBrainJS May 17, 2022
63e559f
fix: add isCancel type assert (#4293)
chenjigeng May 18, 2022
c30252f
Added data URL support for node.js; (#4725)
DigitalBrainJS May 20, 2022
e9c9f33
Fix/4263/maxbodylength defaults (#4731)
mitsos1os May 20, 2022
de973f0
Adding types for progress event callbacks (#4675)
JohannCooper May 20, 2022
467025b
Fixed bug #4727 : toFormData Blob issue on node>v17; (#4728)
DigitalBrainJS May 20, 2022
934f390
URL params serializer; (#4734)
DigitalBrainJS May 25, 2022
c008e57
Added `axios.formToJSON` method; (#4735)
DigitalBrainJS May 25, 2022
59dfed6
Bump grunt from 1.5.2 to 1.5.3 (#4743)
dependabot[bot] May 26, 2022
a02fe28
Updated README.md; (#4742)
DigitalBrainJS May 26, 2022
c731be7
chore: removed Travis CI config file as we have moved to GitHub actions
jasonsaayman May 28, 2022
9bb016f
chore: updated actions to run on new version based branches
jasonsaayman May 28, 2022
a11f950
Fix/4737/timeout error message for http (#4738)
VictorAugDB May 28, 2022
1504792
Fixing content-type header repeated (#4745)
joaoGabriel55 May 28, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix/4263/maxbodylength defaults (#4731)
* test(http): add test case for default body length in follow-redirects

* fix(http): provide proper default body length to follow-redirects

Co-authored-by: Jay <jasonsaayman@gmail.com>
  • Loading branch information
mitsos1os and jasonsaayman authored May 20, 2022
commit e9c9f3392b4a31e24b2bcb8399639de624a24386
3 changes: 3 additions & 0 deletions lib/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,9 @@ module.exports = function httpAdapter(config) {

if (config.maxBodyLength > -1) {
options.maxBodyLength = config.maxBodyLength;
} else {
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
options.maxBodyLength = Infinity;
}

if (config.insecureHTTPParser) {
Expand Down
30 changes: 30 additions & 0 deletions test/unit/adapters/http.js
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,36 @@ describe('supports http with nodejs', function () {
});
});

it('should properly support default max body length (follow-redirects as well)', function (done) {
// taken from https://github.com/follow-redirects/follow-redirects/blob/22e81fc37132941fb83939d1dc4c2282b5c69521/index.js#L461
var followRedirectsMaxBodyDefaults = 10 * 1024 *1024;
var data = Array(2 * followRedirectsMaxBodyDefaults).join('ж');

server = http.createServer(function (req, res) {
res.setHeader('Content-Type', 'text/html; charset=UTF-8');
res.end();
}).listen(4444, function () {
var success = false, failure = false, error;
// send using the default -1 (unlimited axios maxBodyLength)
axios.post('http://localhost:4444/', {
data: data
}).then(function (res) {
success = true;
}).catch(function (err) {
error = err;
failure = true;
});


setTimeout(function () {
assert.equal(success, true, 'request should have succeeded');
assert.equal(failure, false, 'request should not fail');
assert.equal(error, undefined, 'There should not be any error');
done();
}, 100);
});
});

it('should display error while parsing params', function (done) {
server = http.createServer(function () {

Expand Down