Skip to content

Commit

Permalink
Fix Content-Range header
Browse files Browse the repository at this point in the history
  • Loading branch information
distantnative committed May 1, 2024
1 parent 2be8715 commit a216174
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions panel/src/helpers/upload.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ export async function chunked(file, params, size = 5242880) {

for (let i = 0; i < parts; i++) {
const start = i * size;
const end = Math.min(start + size, file.size) + 1;
const end = Math.min(start + size, file.size);
const chunk = file.slice(start, end, file.type);

// when more than one part, add flag to
// recognize as chunked upload and its last chunk
// recognize chunked upload and its last chunk
if (parts > 1) {
params.headers["X-Upload-Chunk"] = i === parts - 1 ? "last" : "chunk";
params.headers["X-Upload-Chunk"] = end === file.size ? "last" : "chunk";
}

response = await upload(chunk, {
Expand Down

0 comments on commit a216174

Please sign in to comment.