Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 26 additions & 2 deletions api-compose-object.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,14 @@ type CopyDestOptions struct {
LegalHold LegalHoldStatus

// Object Retention related fields
Mode RetentionMode
RetainUntilDate time.Time
Mode RetentionMode
RetainUntilDate time.Time
Expires time.Time
ContentType string
ContentEncoding string
ContentDisposition string
ContentLanguage string
CacheControl string

Size int64 // Needs to be specified if progress bar is specified.
// Progress of the entire copy operation will be sent here.
Expand Down Expand Up @@ -116,6 +122,24 @@ func (opts CopyDestOptions) Marshal(header http.Header) {
if opts.Encryption != nil {
opts.Encryption.Marshal(header)
}
if opts.ContentType != "" {
header.Set("Content-Type", opts.ContentType)
}
if opts.ContentEncoding != "" {
header.Set("Content-Encoding", opts.ContentEncoding)
}
if opts.ContentDisposition != "" {
header.Set("Content-Disposition", opts.ContentDisposition)
}
if opts.ContentLanguage != "" {
header.Set("Content-Language", opts.ContentLanguage)
}
if opts.CacheControl != "" {
header.Set("Cache-Control", opts.CacheControl)
}
if !opts.Expires.IsZero() {
header.Set("Expires", opts.Expires.UTC().Format(http.TimeFormat))
}

if opts.ReplaceMetadata {
header.Set("x-amz-metadata-directive", replaceDirective)
Expand Down
3 changes: 1 addition & 2 deletions checksum.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ import (
"errors"
"hash"
"hash/crc32"
"hash/crc64"
"io"
"math/bits"
"net/http"
Expand Down Expand Up @@ -185,7 +184,7 @@ func (c ChecksumType) RawByteLen() int {
case ChecksumSHA256:
return sha256.Size
case ChecksumCRC64NVME:
return crc64.Size
return crc64nvme.Size
}
return 0
}
Expand Down
Loading