Skip to content

Commit 1792eda

Browse files
authored
fix: ensure maxBodyLength is explicitly passed to follow-redirects (#10993)
1 parent 30499d6 commit 1792eda

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎lib/adapters/http.js‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1039,10 +1039,12 @@ export default isHttpAdapterSupported &&
10391039
}
10401040
}
10411041

1042+
// Set an explicit maxBodyLength option for transports that inspect it.
1043+
// When maxBodyLength is -1 (default/unlimited), use Infinity so
1044+
// follow-redirects does not fall back to its own 10MB default.
10421045
if (maxBodyLength > -1) {
10431046
options.maxBodyLength = maxBodyLength;
10441047
} else {
1045-
// follow-redirects does not skip comparison, so it should always succeed for axios -1 unlimited
10461048
options.maxBodyLength = Infinity;
10471049
}
10481050

0 commit comments

Comments
 (0)