From 0f0079ff71b0bd622bafe660f8593a3c9cd6ba31 Mon Sep 17 00:00:00 2001 From: Nick Craig-Wood Date: Wed, 23 Oct 2019 08:41:56 +0100 Subject: [PATCH] b2: remove `unverified:` prefix on sha1 - fixes #3654 --- backend/b2/b2.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/b2/b2.go b/backend/b2/b2.go index 22424b09d..bd01a6d4b 100644 --- a/backend/b2/b2.go +++ b/backend/b2/b2.go @@ -1375,6 +1375,12 @@ func (o *Object) decodeMetaDataRaw(ID, SHA1 string, Size int64, UploadTimestamp if o.sha1 == "" || o.sha1 == "none" { o.sha1 = Info[sha1Key] } + // Remove unverified prefix - see https://www.backblaze.com/b2/docs/uploading.html + // Some tools (eg Cyberduck) use this + const unverified = "unverified:" + if strings.HasPrefix(o.sha1, unverified) { + o.sha1 = o.sha1[len(unverified):] + } o.size = Size // Use the UploadTimestamp if can't get file info o.modTime = time.Time(UploadTimestamp)