mirror of
https://github.com/rclone/rclone.git
synced 2024-11-22 15:30:06 +08:00
Simplify content length processing in s3 with download url
This commit is contained in:
parent
b91c349cd5
commit
bcf0e15ad7
|
@ -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, '/')
|
||||
|
|
Loading…
Reference in New Issue
Block a user