forked from TrueCloudLab/rclone
s3: Treat missing Content-Length as 0 for some ceph installations
This commit is contained in:
parent
083bb154ba
commit
def9adac4e
1 changed files with 9 additions and 4 deletions
7
s3/s3.go
7
s3/s3.go
|
@ -429,11 +429,16 @@ func (o *FsObjectS3) readMetaData() (err error) {
|
||||||
fs.Debug(o, "Failed to read info: %s", err)
|
fs.Debug(o, "Failed to read info: %s", err)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
size, err := strconv.ParseInt(headers["Content-Length"], 10, 64)
|
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 {
|
if err != nil {
|
||||||
fs.Debug(o, "Failed to read size from: %q", headers)
|
fs.Debug(o, "Failed to read size from: %q", headers)
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
}
|
||||||
o.etag = headers["Etag"]
|
o.etag = headers["Etag"]
|
||||||
o.bytes = size
|
o.bytes = size
|
||||||
o.meta = headers
|
o.meta = headers
|
||||||
|
|
Loading…
Reference in a new issue