diff --git a/internal/backend/b2/b2.go b/internal/backend/b2/b2.go index 471ff1c62..704a85980 100644 --- a/internal/backend/b2/b2.go +++ b/internal/backend/b2/b2.go @@ -200,6 +200,7 @@ func (be *b2Backend) Save(ctx context.Context, h restic.Handle, rd restic.Rewind debug.Log("Save %v, name %v", h, name) obj := be.bucket.Object(name) + // b2 always requires sha1 checksums for uploaded file parts w := obj.NewWriter(ctx) n, err := io.Copy(w, rd) debug.Log(" saved %d bytes, err %v", n, err) diff --git a/internal/backend/s3/s3.go b/internal/backend/s3/s3.go index 6fee1fd66..539ff5a4e 100644 --- a/internal/backend/s3/s3.go +++ b/internal/backend/s3/s3.go @@ -270,6 +270,8 @@ func (be *Backend) Save(ctx context.Context, h restic.Handle, rd restic.RewindRe opts := minio.PutObjectOptions{StorageClass: be.cfg.StorageClass} opts.ContentType = "application/octet-stream" + // the only option with the high-level api is to let the library handle the checksum computation + opts.SendContentMd5 = true debug.Log("PutObject(%v, %v, %v)", be.cfg.Bucket, objName, rd.Length()) info, err := be.client.PutObject(ctx, be.cfg.Bucket, objName, ioutil.NopCloser(rd), int64(rd.Length()), opts)