Skip to content

Commit 6eebdd6

Browse files
authored
Add Expires to PutObject opts (#1900)
1 parent e0b6838 commit 6eebdd6

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

.github/workflows/vulncheck.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
runs-on: ubuntu-latest
1515
strategy:
1616
matrix:
17-
go-version: [ 1.21.0 ]
17+
go-version: [ 1.21.4 ]
1818
steps:
1919
- name: Check out code into the Go module directory
2020
uses: actions/checkout@v3

api-put-object.go

+5
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ type PutObjectOptions struct {
7777
ContentDisposition string
7878
ContentLanguage string
7979
CacheControl string
80+
Expires time.Time
8081
Mode RetentionMode
8182
RetainUntilDate time.Time
8283
ServerSideEncryption encrypt.ServerSide
@@ -153,6 +154,10 @@ func (opts PutObjectOptions) Header() (header http.Header) {
153154
header.Set("Cache-Control", opts.CacheControl)
154155
}
155156

157+
if !opts.Expires.IsZero() {
158+
header.Set("Expires", opts.Expires.UTC().Format(http.TimeFormat))
159+
}
160+
156161
if opts.Mode != "" {
157162
header.Set(amzLockMode, opts.Mode.String())
158163
}

0 commit comments

Comments
 (0)