Skip to content
Snippets Groups Projects
Commit 421e7485 authored by James Page's avatar James Page
Browse files

#28 Set expiry of presigned download URL to be the same as the expiry of the S3 object

parent 80abe74e
Branches
Tags
1 merge request!31Resolve "Set presigned URL download duration to the same as the S3 object cache expiry duration."
...@@ -198,7 +198,11 @@ func (s SessionWithHelpers) UploadWithSettingsRevised(data []byte, bucket string ...@@ -198,7 +198,11 @@ func (s SessionWithHelpers) UploadWithSettingsRevised(data []byte, bucket string
} }
} }
uploadUrl, err = s.GetSignedDownloadURL(bucket, fileName, 24*time.Hour, headers) downloadUrlExpiry := 24 * time.Hour
if settings.ExpiryDuration != nil {
downloadUrlExpiry = *settings.ExpiryDuration
}
uploadUrl, err = s.GetSignedDownloadURL(bucket, fileName, downloadUrlExpiry, headers)
if err != nil { if err != nil {
return S3UploadResponse{}, err return S3UploadResponse{}, err
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment