From 9beddf626fba3f187f552fa13d05e1fee08ac538 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Budai?= Date: Mon, 3 Apr 2023 14:09:14 +0200 Subject: [PATCH] upload/azure: remove the MD5 sum check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- internal/upload/azure/azurestorage.go | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/internal/upload/azure/azurestorage.go b/internal/upload/azure/azurestorage.go index a94b67f27..45494695d 100644 --- a/internal/upload/azure/azurestorage.go +++ b/internal/upload/azure/azurestorage.go @@ -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 }