Skip to content

Commit

Permalink
fix(formdata): fixed setting NaN as Content-Length for form payload i…
Browse files Browse the repository at this point in the history
…n some cases; (#5535)
  • Loading branch information
DigitalBrainJS committed Feb 11, 2023
1 parent ea87ebf commit c19f7bf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/adapters/http.js
Expand Up @@ -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) {
}
Expand Down

0 comments on commit c19f7bf

Please sign in to comment.