From 1063864b77a26f07c5c56b8abca1574f0d4b711b Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Sun, 5 Jan 2025 02:06:42 -0800 Subject: [PATCH] allow checksum headers in single PutObject() --- include/miniocpp/response.h | 4 ++++ src/baseclient.cc | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/include/miniocpp/response.h b/include/miniocpp/response.h index 93fcda97..7ede8edf 100644 --- a/include/miniocpp/response.h +++ b/include/miniocpp/response.h @@ -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; diff --git a/src/baseclient.cc b/src/baseclient.cc index 46032a74..30c57def 100644 --- a/src/baseclient.cc +++ b/src/baseclient.cc @@ -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; }