From f2c187bf7c725de20ff3c7eb7457143225c00ff6 Mon Sep 17 00:00:00 2001 From: Daniel Valdivia <18384552+dvaldivia@users.noreply.github.com> Date: Thu, 14 Apr 2022 09:44:08 -0700 Subject: [PATCH] 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> --- restapi/user_objects.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 != "" {