Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 085f568

Browse filesBrowse files
authored
fix(fetch): fix content length calculation for FormData payload; (#6524)
1 parent 59cd6b0 commit 085f568
Copy full SHA for 085f568

File tree

1 file changed

+5
-1
lines changed
Filter options

1 file changed

+5
-1
lines changed

‎lib/adapters/fetch.js

Copy file name to clipboardExpand all lines: lib/adapters/fetch.js
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,11 @@ const getBodyLength = async (body) => {
6969
}
7070

7171
if(utils.isSpecCompliantForm(body)) {
72-
return (await new Request(body).arrayBuffer()).byteLength;
72+
const _request = new Request(platform.origin, {
73+
method: 'POST',
74+
body,
75+
});
76+
return (await _request.arrayBuffer()).byteLength;
7377
}
7478

7579
if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.