Skip to content

CompleteMultipartUpload response omits ChecksumType #47

Description

@Vonng

Expected Behavior

The CompleteMultipartUploadResult XML should carry <ChecksumType> when the object has a
checksum, as AWS S3 does. The
API reference
lists it in the response body with valid values COMPOSITE | FULL_OBJECT.

Current Behavior

The field does not exist on the response struct, so it is never emitted:

cmd/api-response.go

type CompleteMultipartUploadResponse struct {
	XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ CompleteMultipartUploadResult" json:"-"`

	Location string
	Bucket   string
	Key      string
	ETag     string

	ChecksumCRC32     string `xml:"ChecksumCRC32,omitempty"`
	ChecksumCRC32C    string `xml:"ChecksumCRC32C,omitempty"`
	ChecksumSHA1      string `xml:"ChecksumSHA1,omitempty"`
	ChecksumSHA256    string `xml:"ChecksumSHA256,omitempty"`
	ChecksumCRC64NVME string `xml:",omitempty"`
}

generateCompleteMultipartUploadResponse already computes the map that contains it
(oi.decryptChecksums returns x-amz-checksum-type), it is simply dropped on the floor.

Observed with real boto3 1.43.58 against a FULL_OBJECT CRC32 upload:

complete_multipart_upload() -> ChecksumType: None          # AWS returns FULL_OBJECT
head_object()               -> ChecksumType: FULL_OBJECT   # correct

ListParts (api-response.go) and GetObjectAttributes (object-handlers.go) both return
the field correctly; only the completion response is missing it.

Impact

Presentation only - no data is affected. Clients that validate the returned checksum type
after completing an upload see a null value.

Context

Found while root-causing #31.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status
    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions