Skip to content

Commit b8ebbf3

Browse files
allow checksum headers in single PutObject() (#184)
1 parent 818d203 commit b8ebbf3

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

include/miniocpp/response.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,10 @@ struct CreateMultipartUploadResponse : public Response {
190190
struct PutObjectResponse : public Response {
191191
std::string etag;
192192
std::string version_id;
193+
std::string checksumCRC32;
194+
std::string checksumCRC32C;
195+
std::string checksumSHA1;
196+
std::string checksumSHA256;
193197

194198
PutObjectResponse() = default;
195199

src/baseclient.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1384,6 +1384,10 @@ PutObjectResponse BaseClient::PutObject(PutObjectApiArgs args) {
13841384
PutObjectResponse resp;
13851385
resp.etag = utils::Trim(response.headers.GetFront("etag"), '"');
13861386
resp.version_id = response.headers.GetFront("x-amz-version-id");
1387+
resp.checksumCRC32 = response.headers.GetFront("x-amz-checksum-crc32");
1388+
resp.checksumCRC32C = response.headers.GetFront("x-amz-checksum-crc32c");
1389+
resp.checksumSHA1 = response.headers.GetFront("x-amz-checksum-sha1");
1390+
resp.checksumSHA256 = response.headers.GetFront("x-amz-checksum-sha256");
13871391

13881392
return resp;
13891393
}

0 commit comments

Comments
 (0)