From bcf0e15ad7b2585c865cf3cccaf5c0d247e7a223 Mon Sep 17 00:00:00 2001 From: Logeshwaran Murugesan Date: Thu, 25 Nov 2021 14:40:25 +0530 Subject: [PATCH] Simplify content length processing in s3 with download url --- backend/s3/s3.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/backend/s3/s3.go b/backend/s3/s3.go index 91a7dd24d..29975236c 100644 --- a/backend/s3/s3.go +++ b/backend/s3/s3.go @@ -3325,11 +3325,7 @@ func (o *Object) downloadFromURL(ctx context.Context, bucketPath string, options return nil, err } - size, err := strconv.ParseInt(resp.Header.Get("Content-Length"), 10, 64) - if err != nil { - fs.Debugf(o, "Failed to parse content length from string %s, %v", resp.Header.Get("Content-Length"), err) - } - contentLength := &size + contentLength := &resp.ContentLength if resp.Header.Get("Content-Range") != "" { var contentRange = resp.Header.Get("Content-Range") slash := strings.IndexRune(contentRange, '/')