Describe the bug
As part of the upgrade of follow-redirects in #2689, a default maxBodyLength of 10MB began to be enforced (previously, there was no request payload limit). There are a few issues with this:
- The default limit is not mentioned in the
axios documentation
- This change in defaults is not included as a breaking change in the
axios changelog
- The default is unlimited when
maxRedirects = 0
To Reproduce
axios.post('/size', 'x'.repeat(1e8))
// -> Error: Request body larger than maxBodyLength limit
axios.post('/size', 'x'.repeat(1e8), { maxBodyLength: -1 })
// -> Error: Request body larger than maxBodyLength limit
axios.post('/size', 'x'.repeat(1e8), { maxRedirects: 0 })
// -> OK
axios.post('/size', 'x'.repeat(1e8), { maxBodyLength: Infinity })
// -> OK
Expected behavior
The default maxBodyLength should be consistent and documented, regardless of the value of maxRedirects.
Environment
- Axios Version: 0.24.0
- Adapter: HTTP
- Browser: N/A
- Browser Version: N/A
- Node.js Version: 16.13.0
- OS: OS X 11.6
- Additional Library Versions: N/A
Additional context/Screenshots
This is related to #3786, although I don't think that PR goes far enough to correct the inconsistent behavior.
Describe the bug
As part of the upgrade of
follow-redirectsin #2689, a defaultmaxBodyLengthof 10MB began to be enforced (previously, there was no request payload limit). There are a few issues with this:axiosdocumentationaxioschangelogmaxRedirects = 0To Reproduce
Expected behavior
The default
maxBodyLengthshould be consistent and documented, regardless of the value ofmaxRedirects.Environment
Additional context/Screenshots
This is related to #3786, although I don't think that PR goes far enough to correct the inconsistent behavior.