mirror of
https://github.com/rclone/rclone
synced 2024-12-22 13:03:02 +01:00
s3: Treat missing Content-Length as 0 for some ceph installations
This commit is contained in:
parent
083bb154ba
commit
def9adac4e
13
s3/s3.go
13
s3/s3.go
@ -429,10 +429,15 @@ func (o *FsObjectS3) readMetaData() (err error) {
|
||||
fs.Debug(o, "Failed to read info: %s", err)
|
||||
return err
|
||||
}
|
||||
size, err := strconv.ParseInt(headers["Content-Length"], 10, 64)
|
||||
if err != nil {
|
||||
fs.Debug(o, "Failed to read size from: %q", headers)
|
||||
return err
|
||||
var size int64
|
||||
// Ignore missing Content-Length assuming it is 0
|
||||
// Some versions of ceph do this due their apache proxies
|
||||
if contentLength, ok := headers["Content-Length"]; ok {
|
||||
size, err = strconv.ParseInt(contentLength, 10, 64)
|
||||
if err != nil {
|
||||
fs.Debug(o, "Failed to read size from: %q", headers)
|
||||
return err
|
||||
}
|
||||
}
|
||||
o.etag = headers["Etag"]
|
||||
o.bytes = size
|
||||
|
Loading…
Reference in New Issue
Block a user