mirror of
https://github.com/wgh136/nysoure.git
synced 2025-09-27 20:27:23 +00:00
Increase presigned URL expiration time from 10 to 20 seconds in S3 download method
This commit is contained in:
@@ -59,7 +59,7 @@ func (s *S3Storage) Download(storageKey string, fileName string) (string, error)
|
|||||||
}
|
}
|
||||||
reqParams := make(url.Values)
|
reqParams := make(url.Values)
|
||||||
reqParams.Set("response-content-disposition", "attachment; filename=\""+url.QueryEscape(fileName)+"\"")
|
reqParams.Set("response-content-disposition", "attachment; filename=\""+url.QueryEscape(fileName)+"\"")
|
||||||
presignedURL, err := minioClient.PresignedGetObject(context.Background(), s.BucketName, storageKey, 10*time.Second, reqParams)
|
presignedURL, err := minioClient.PresignedGetObject(context.Background(), s.BucketName, storageKey, 20*time.Second, reqParams)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
return "", errors.New("failed to generate presigned URL")
|
return "", errors.New("failed to generate presigned URL")
|
||||||
|
Reference in New Issue
Block a user