mirror of
https://github.com/tenrok/axios.git
synced 2026-05-15 11:59:42 +03:00
fix(fetch): fix content length calculation for FormData payload; (#6524)
This commit is contained in:
committed by
GitHub
parent
59cd6b0dec
commit
085f56861a
@@ -69,7 +69,11 @@ const getBodyLength = async (body) => {
|
||||
}
|
||||
|
||||
if(utils.isSpecCompliantForm(body)) {
|
||||
return (await new Request(body).arrayBuffer()).byteLength;
|
||||
const _request = new Request(platform.origin, {
|
||||
method: 'POST',
|
||||
body,
|
||||
});
|
||||
return (await _request.arrayBuffer()).byteLength;
|
||||
}
|
||||
|
||||
if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {
|
||||
|
||||
Reference in New Issue
Block a user