mirror of
https://github.com/axios/axios.git
synced 2026-04-12 02:31:57 +08:00
fix(formdata): fixed setting NaN as Content-Length for form payload in some cases; (#5535)
This commit is contained in:
parent
ea87ebfe6d
commit
c19f7bf770
@ -264,7 +264,7 @@ export default isHttpAdapterSupported && function httpAdapter(config) {
|
||||
if (!headers.hasContentLength()) {
|
||||
try {
|
||||
const knownLength = await util.promisify(data.getLength).call(data);
|
||||
headers.setContentLength(knownLength);
|
||||
Number.isFinite(knownLength) && knownLength >= 0 && headers.setContentLength(knownLength);
|
||||
/*eslint no-empty:0*/
|
||||
} catch (e) {
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user