Skip to content

Commit

Permalink
Add Expires to PutObject opts
Browse files Browse the repository at this point in the history
  • Loading branch information
Anis Elleuch committed Nov 19, 2023
1 parent e0b6838 commit 7d58f06
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions api-put-object.go
Expand Up @@ -77,6 +77,7 @@ type PutObjectOptions struct {
ContentDisposition string
ContentLanguage string
CacheControl string
Expires time.Time
Mode RetentionMode
RetainUntilDate time.Time
ServerSideEncryption encrypt.ServerSide
Expand Down Expand Up @@ -153,6 +154,10 @@ func (opts PutObjectOptions) Header() (header http.Header) {
header.Set("Cache-Control", opts.CacheControl)
}

if !opts.Expires.IsZero() {
header.Set("Expires", opts.Expires.Format(http.TimeFormat))
}

if opts.Mode != "" {
header.Set(amzLockMode, opts.Mode.String())
}
Expand Down

0 comments on commit 7d58f06

Please sign in to comment.