Skip to content

Commit

Permalink
b2: remove unverified: prefix on sha1 - fixes #3654
Browse files Browse the repository at this point in the history
  • Loading branch information
ncw committed Oct 23, 2019
1 parent 18c029e commit 0f0079f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions backend/b2/b2.go
Expand Up @@ -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)
Expand Down

0 comments on commit 0f0079f

Please sign in to comment.