Fix early context cancellation when downloading/previewing object (#1846)

* Fix early context cancellation when downloading/previewing object
Signed-off-by: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com>
This commit is contained in:
Daniel Valdivia
2022-04-14 09:44:08 -07:00
committed by GitHub
parent 243e51fe83
commit f2c187bf7c

View File

@@ -367,8 +367,8 @@ func parseRange(s string, size int64) ([]httpRange, error) {
}
func getDownloadObjectResponse(session *models.Principal, params user_api.DownloadObjectParams) (middleware.Responder, *models.Error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := context.Background()
var prefix string
mClient, err := newMinioClient(session)
if err != nil {
@@ -468,8 +468,8 @@ func getDownloadObjectResponse(session *models.Principal, params user_api.Downlo
}), nil
}
func getDownloadFolderResponse(session *models.Principal, params user_api.DownloadObjectParams) (middleware.Responder, *models.Error) {
ctx, cancel := context.WithCancel(context.Background())
defer cancel()
ctx := context.Background()
var prefix string
mClient, err := newMinioClient(session)
if params.Prefix != "" {