upload/azure: remove the MD5 sum check
It doesn't actually make any sense. For Page Blobs, Azure doesn't compute any hashes. The MD5 sum is basically just a property, which we set by one call and get by the other call. See https://stackoverflow.com/questions/42229153/how-to-check-azure-storage-blob-file-uploaded-correctly/69319211#69319211 for more info. Signed-off-by: Ondřej Budai <ondrej@budai.cz>
This commit is contained in:
parent
5e6d47e9d0
commit
9beddf626f
1 changed files with 0 additions and 11 deletions
|
|
@ -162,17 +162,6 @@ func (c StorageClient) UploadPageBlob(metadata BlobMetadata, fileName string, th
|
|||
return err
|
||||
default:
|
||||
}
|
||||
// Check properties, specifically MD5 sum of the blob
|
||||
props, err := blobURL.GetProperties(ctx, azblob.BlobAccessConditions{}, azblob.ClientProvidedKeyOptions{})
|
||||
if err != nil {
|
||||
return fmt.Errorf("getting the properties of the new blob failed: %v", err)
|
||||
}
|
||||
var blobChecksum []byte = props.ContentMD5()
|
||||
var fileChecksum []byte = imageFileHash.Sum(nil)
|
||||
|
||||
if !bytes.Equal(blobChecksum, fileChecksum) {
|
||||
return errors.New("error during image upload. the image seems to be corrupted")
|
||||
}
|
||||
|
||||
return nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue