mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
fix(formdata): fixed setting NaN as Content-Length for form payload in some cases; (#5535)
This commit is contained in:
@@ -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) {
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user