2
0
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:
Dmitriy Mozgovoy
2023-02-11 16:34:51 +02:00
committed by GitHub
parent ea87ebfe6d
commit c19f7bf770
+1 -1
View File
@@ -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) {
}