Merge c7126381256231f32694455a1763b5070002f4d8 into 0b9671313b14ffe839ecbd7dd2ae5ac7f6f05db8

This commit is contained in:
ahxxm 2025-04-13 16:28:19 +09:00 committed by GitHub
commit fcd98ddf6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1883,9 +1883,14 @@ func (o *Object) getOrHead(ctx context.Context, method string, options []fs.Open
// --b2-download-url cloudflare strips the Content-Length
// headers (presumably so it can inject stuff) so use the old
// 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 {
info.Size = o.size
}
if info.ID == "" {
info.ID = o.id
}
return resp, info, nil
}