Increase presigned URL expiration time from 10 to 20 seconds in S3 download method

This commit is contained in:
nyne
2025-05-23 15:32:02 +08:00
parent 22c17e5d9a
commit 926391dc85

View File

@@ -59,7 +59,7 @@ func (s *S3Storage) Download(storageKey string, fileName string) (string, error)
}
reqParams := make(url.Values)
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 {
fmt.Println(err)
return "", errors.New("failed to generate presigned URL")