Redirect body larger than maxBodyLength not correctly caught
See original GitHub issueSummary
Recently #1323 has been fixed, however follow-redirects
is still not correctly implemented: current version does not handle errors correctly.
Indeed, if maxBodyLength
is 10MB and the resource fetched after the redirect is bigger, follow-redirects
will emit an error but that error will occur outside of axios promise chain.
Error: Request body larger than maxBodyLength limit
at RedirectableRequest.write (./node_modules/follow-redirects/index.js:66:24)
at FormData.CombinedStream.write (./node_modules/combined-stream/lib/combined_stream.js:118:8)
at FormData.CombinedStream._pipeNext (./node_modules/combined-stream/lib/combined_stream.js:106:8)
at FormData.CombinedStream._getNext (./node_modules/combined-stream/lib/combined_stream.js:79:10)
at FormData.CombinedStream._pipeNext (./node_modules/combined-stream/lib/combined_stream.js:107:8)
at FormData.CombinedStream._getNext (./node_modules/combined-stream/lib/combined_stream.js:79:10)
at FormData.CombinedStream.resume (./node_modules/combined-stream/lib/combined_stream.js:134:10)
at FormData.CombinedStream.pipe (./node_modules/combined-stream/lib/combined_stream.js:64:8)
at dispatchHttpRequest (./node_modules/axios/lib/adapters/http.js:227:12)
at httpAdapter (./node_modules/axios/lib/adapters/http.js:18:10)
at dispatchRequest (./node_modules/axios/lib/core/dispatchRequest.js:59:10)
Axios should intercept that error and reject the promise
Context
- axios version: v0.17.1 + master
- Environment: node v8.4.0
Issue Analytics
- State:
- Created 6 years ago
- Reactions:16
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Error: Request body larger than maxBodyLength limit when ...
You are setting 'maxContentLength': Infinity, 'maxBodyLength': Infinity. In your data object. It should be inside the config object, ...
Read more >Deploy Ghost Theme Github Actions CI / Error: Request body ...
Error: Request body larger than maxBodyLength limit at RedirectableRequest.module.exports.549.RedirectableRequest.write ...
Read more >node_modules/axios/CHANGELOG.md - PLMlab
Fixing response with utf-8 BOM can not parse to json (#2419) ... Add test for redirecting with too large response (#2695); Fixing unit...
Read more >axios error err_bad_response - You.com | The AI Search ...
It is not an issue with the API. To Reproduce. Axios post request throws a network error message. If I make the call...
Read more >axios/CHANGELOG.md - UNPKG
83, - Fixing changelog to show correct pull request ... 466, Rewrote the comment from "Reject only if the status code is greater...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
axios should default
follow-redirect
maxBodyLength
limit toInfinity
Facing same issue . Even after adding maxContentLength: 52428890 to axios post request has not fixed it.