Skip to content

Commit e43d80f

Browse files
authored
fix(message): Fixed bug in final length calculation in Multipart Encoded (#100)
Previously, footerLength was added as many times as the number of contents, but we changed it to adding it only once at the end.
1 parent 0224b1f commit e43d80f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/message.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,13 @@ function multipartEncode(
149149
const contentArray = new Uint8Array(datasetBuffer);
150150
const contentLength = contentArray.length;
151151

152-
length += headerLength + contentLength + footerLength;
152+
length += headerLength + contentLength
153153

154154
return contentArray;
155155
});
156156

157+
length += footerLength;
158+
157159
// Allocate the array
158160
const multipartArray = new Uint8Array(length);
159161

0 commit comments

Comments
 (0)