Skip to content

Commit

Permalink
fix(message): Fixed bug in final length calculation in Multipart Encoded
Browse files Browse the repository at this point in the history
Previously, footerLength was added as many times as the number of contents, but we changed it to adding it only once at the end.
  • Loading branch information
knight2995 authored Nov 6, 2024
1 parent 78c8a48 commit 818653e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -149,11 +149,13 @@ function multipartEncode(
const contentArray = new Uint8Array(datasetBuffer);
const contentLength = contentArray.length;

length += headerLength + contentLength + footerLength;
length += headerLength + contentLength

return contentArray;
});

length += footerLength;

// Allocate the array
const multipartArray = new Uint8Array(length);

Expand Down

0 comments on commit 818653e

Please sign in to comment.