Skip to content

Commit db8e206

Browse files
emrochaebozduman
andauthored
PutObjectAsync with Snowball header must not use multipart (#786)
* PutObjectAsync with Snowball header must not use multipart PutObjectAsync must not use multipart if has header "X-Amz-Meta-Snowball-Auto-Extract=true" See minio/minio#17033 * Lint changes --------- Co-authored-by: Ersan <ersan.bozduman@gmail.com>
1 parent 5e82e86 commit db8e206

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

Minio/ApiEndpoints/ObjectOperations.cs

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -561,8 +561,13 @@ public async Task<PutObjectResponse> PutObjectAsync(PutObjectArgs args,
561561
args?.Validate();
562562
args.SSE?.Marshal(args.Headers);
563563

564-
// Upload object in single part if size falls under restricted part size.
565-
if (args.ObjectSize < Constants.MinimumPartSize && args.ObjectSize >= 0 && args.ObjectStreamData is not null)
564+
var isSnowball = args.Headers.ContainsKey("X-Amz-Meta-Snowball-Auto-Extract") &&
565+
Convert.ToBoolean(args.Headers["X-Amz-Meta-Snowball-Auto-Extract"]);
566+
567+
// Upload object in single part if size falls under restricted part size
568+
// or the request has snowball objects
569+
if ((args.ObjectSize < Constants.MinimumPartSize || isSnowball) && args.ObjectSize >= 0 &&
570+
args.ObjectStreamData is not null)
566571
{
567572
var bytes = await ReadFullAsync(args.ObjectStreamData, (int)args.ObjectSize).ConfigureAwait(false);
568573
var bytesRead = bytes.Length;

0 commit comments

Comments
 (0)