diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go index 7b6edd7aa..d21459d34 100644 --- a/cmd/object-handlers.go +++ b/cmd/object-handlers.go @@ -2106,7 +2106,19 @@ func (api objectAPIHandlers) PutObjectExtractHandler(w http.ResponseWriter, r *h writeErrorResponse(ctx, w, toAPIError(ctx, err), r.URL) return } - metadata[xhttp.AmzStorageClass] = sc + + // Remove the snowball headers from metadata from objects + // since those are actionable headers and not for storage + delete(metadata, xhttp.AmzSnowballExtract) + delete(metadata, xhttp.AmzSnowballExtract) + delete(metadata, xhttp.MinIOSnowballIgnoreDirs) + delete(metadata, xhttp.MinIOSnowballIgnoreErrors) + delete(metadata, xhttp.MinIOSnowballPrefix) + + // Use the same storage class as the original uploaded tar file + if sc != "" { + metadata[xhttp.AmzStorageClass] = sc + } putObjectTar := func(reader io.Reader, info os.FileInfo, object string) error { size := info.Size() diff --git a/internal/http/headers.go b/internal/http/headers.go index a960ee147..9d989279f 100644 --- a/internal/http/headers.go +++ b/internal/http/headers.go @@ -89,8 +89,9 @@ const ( AmzObjectLockLegalHold = "X-Amz-Object-Lock-Legal-Hold" AmzObjectLockBypassGovernance = "X-Amz-Bypass-Governance-Retention" AmzBucketReplicationStatus = "X-Amz-Replication-Status" - AmzSnowballExtract = "X-Amz-Meta-Snowball-Auto-Extract" + // AmzSnowballExtract will trigger unpacking of an archive content + AmzSnowballExtract = "X-Amz-Meta-Snowball-Auto-Extract" // MinIOSnowballIgnoreDirs will skip creating empty directory objects. MinIOSnowballIgnoreDirs = "X-Amz-Meta-Minio-Snowball-Ignore-Dirs" // MinIOSnowballIgnoreErrors will ignore recoverable errors, typically single files failing to upload.