mirror of
https://github.com/rclone/rclone.git
synced 2025-06-26 15:01:41 +02:00
b2: use file id from listing when not presented in headers - fixes #8113
This commit is contained in:
parent
ddebca8d42
commit
e2d6872745
@ -1883,9 +1883,14 @@ func (o *Object) getOrHead(ctx context.Context, method string, options []fs.Open
|
|||||||
// --b2-download-url cloudflare strips the Content-Length
|
// --b2-download-url cloudflare strips the Content-Length
|
||||||
// headers (presumably so it can inject stuff) so use the old
|
// headers (presumably so it can inject stuff) so use the old
|
||||||
// length read from the listing.
|
// length read from the listing.
|
||||||
|
// Additionally, the official examples return S3 headers
|
||||||
|
// instead of native, i.e. no file ID, use ones from listing.
|
||||||
if info.Size < 0 {
|
if info.Size < 0 {
|
||||||
info.Size = o.size
|
info.Size = o.size
|
||||||
}
|
}
|
||||||
|
if info.ID == "" {
|
||||||
|
info.ID = o.id
|
||||||
|
}
|
||||||
return resp, info, nil
|
return resp, info, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user