diff --git a/.github/workflows/vulncheck.yml b/.github/workflows/vulncheck.yml index 2d3beaa9b..cbe4cd8bf 100644 --- a/.github/workflows/vulncheck.yml +++ b/.github/workflows/vulncheck.yml @@ -14,7 +14,7 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - go-version: [ 1.21.0 ] + go-version: [ 1.21.x ] steps: - name: Check out code into the Go module directory uses: actions/checkout@v3 diff --git a/api-put-object.go b/api-put-object.go index 2c4de4f96..bbd8924e2 100644 --- a/api-put-object.go +++ b/api-put-object.go @@ -77,6 +77,7 @@ type PutObjectOptions struct { ContentDisposition string ContentLanguage string CacheControl string + Expires time.Time Mode RetentionMode RetainUntilDate time.Time ServerSideEncryption encrypt.ServerSide @@ -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.UTC().Format(http.TimeFormat)) + } + if opts.Mode != "" { header.Set(amzLockMode, opts.Mode.String()) }