From e2d68727457c184e1ed38e7e4c893eab2f718328 Mon Sep 17 00:00:00 2001 From: ahxxm Date: Thu, 5 Jun 2025 00:23:58 +0900 Subject: [PATCH] b2: use file id from listing when not presented in headers - fixes #8113 --- backend/b2/b2.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index e8ed3bd72..71c3ccb9b 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -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 }