Skip to content

Commit f2c187b

Browse files
authored
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>
1 parent 243e51f commit f2c187b

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

restapi/user_objects.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,8 +367,8 @@ func parseRange(s string, size int64) ([]httpRange, error) {
367367
}
368368

369369
func getDownloadObjectResponse(session *models.Principal, params user_api.DownloadObjectParams) (middleware.Responder, *models.Error) {
370-
ctx, cancel := context.WithCancel(context.Background())
371-
defer cancel()
370+
ctx := context.Background()
371+
372372
var prefix string
373373
mClient, err := newMinioClient(session)
374374
if err != nil {
@@ -468,8 +468,8 @@ func getDownloadObjectResponse(session *models.Principal, params user_api.Downlo
468468
}), nil
469469
}
470470
func getDownloadFolderResponse(session *models.Principal, params user_api.DownloadObjectParams) (middleware.Responder, *models.Error) {
471-
ctx, cancel := context.WithCancel(context.Background())
472-
defer cancel()
471+
ctx := context.Background()
472+
473473
var prefix string
474474
mClient, err := newMinioClient(session)
475475
if params.Prefix != "" {

0 commit comments

Comments
 (0)