Skip to content

Commit

Permalink
this time baby
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarYuran committed Dec 1, 2024
1 parent 1429bb8 commit 1bb78a7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webui/src/pages/repositories/repository/objects.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ function extractChecksumFromResponse(rawHeaders) {
return acc;
}, {});
if (parsedHeaders['content-md5']) {
// drop any quote and space
return parsedHeaders['content-md5'];
}
// fallback to ETag
Expand All @@ -262,7 +263,10 @@ const uploadFile = async (config, repo, reference, path, file, onProgress) => {
if (uploadResponse.status >= 400) {
throw new Error(`Error uploading file: HTTP ${uploadResponse.status}`);
}
const checksum = extractChecksumFromResponse(uploadResponse.rawHeaders);
const checksum = extractChecksumFromResponse(uploadResponse.rawHeaders);
if (checksum === null) {
throw new Error(`CORS settings error. Must configure "exposedHeaders" field`);
}
await staging.link(repo.id, reference.id, fpath, getResp, checksum, file.size, file.type);
} else {
await objects.upload(repo.id, reference.id, fpath, file, onProgress);
Expand Down

0 comments on commit 1bb78a7

Please sign in to comment.