diff --git a/restapi/user_objects.go b/restapi/user_objects.go index 63906aff0..ee05b1af0 100644 --- a/restapi/user_objects.go +++ b/restapi/user_objects.go @@ -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 != "" {