-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
maxBodyLength does not work with disabled redirects #3769
Copy link
Copy link
Closed
Description
Describe the bug
maxBodyLength does not work with disabled redirects like when using { maxRedirects: 0, maxBodyLength: 100 } in options.
To Reproduce
require("axios")
.put("http://www.example.com", Buffer.alloc(1000), { maxRedirects: 0, maxBodyLength: 100 })
.catch(e => console.log("axios returned error:", e));Expected behavior
It should print something like:
axios returned error: Error [ERR_FR_MAX_BODY_LENGTH_EXCEEDED]: Request body larger than maxBodyLength limit
...
As this example does:
require("axios")
.put("http://www.example.com", Buffer.alloc(1000), { maxBodyLength: 100 })
.catch(e => console.log("axios returned error:", e));Environment
- Axios Version 0.21.1
- Adapter HTTP
- Node.js Version v15.12.0
Additional context/Screenshots
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels