Skip to content

Commit

Permalink
allow checksum headers in single PutObject() (#184)
Browse files Browse the repository at this point in the history
  • Loading branch information
harshavardhana authored Jan 5, 2025
1 parent 818d203 commit b8ebbf3
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/miniocpp/response.h
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,10 @@ struct CreateMultipartUploadResponse : public Response {
struct PutObjectResponse : public Response {
std::string etag;
std::string version_id;
std::string checksumCRC32;
std::string checksumCRC32C;
std::string checksumSHA1;
std::string checksumSHA256;

PutObjectResponse() = default;

Expand Down
4 changes: 4 additions & 0 deletions src/baseclient.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1384,6 +1384,10 @@ PutObjectResponse BaseClient::PutObject(PutObjectApiArgs args) {
PutObjectResponse resp;
resp.etag = utils::Trim(response.headers.GetFront("etag"), '"');
resp.version_id = response.headers.GetFront("x-amz-version-id");
resp.checksumCRC32 = response.headers.GetFront("x-amz-checksum-crc32");
resp.checksumCRC32C = response.headers.GetFront("x-amz-checksum-crc32c");
resp.checksumSHA1 = response.headers.GetFront("x-amz-checksum-sha1");
resp.checksumSHA256 = response.headers.GetFront("x-amz-checksum-sha256");

return resp;
}
Expand Down

0 comments on commit b8ebbf3

Please sign in to comment.