mirror of
https://github.com/rclone/rclone
synced 2024-11-18 18:46:07 +01:00
b2: Fix SHA1 mismatch when downloading files with no SHA1 #678
Some large files (depending on which version of rclone they were uploaded with and where they were uploaded from) don't have an SHA1, so we can't check it in that case.
This commit is contained in:
parent
921fcc0723
commit
8207af9460
2
b2/b2.go
2
b2/b2.go
@ -1133,7 +1133,7 @@ func (file *openFile) Close() (err error) {
|
||||
// Check the SHA1
|
||||
receivedSHA1 := file.o.sha1
|
||||
calculatedSHA1 := fmt.Sprintf("%x", file.hash.Sum(nil))
|
||||
if receivedSHA1 != calculatedSHA1 {
|
||||
if receivedSHA1 != "" && receivedSHA1 != calculatedSHA1 {
|
||||
return errors.Errorf("object corrupted on transfer - SHA1 mismatch (want %q got %q)", receivedSHA1, calculatedSHA1)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user