It doesn't return an error when upload block blob with wrong blobContentMD5 in Azurite
- Dominant language
- TypeScript
- Stars
- 2.3k
- Forks
- 393
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 36
Description
**Error Description:**
In Azure, it will return an error `Md5Mismatch` if the uploaded md5 value is wrong when upload block blob.
But in Azurite. it will upload block blob successfully.
Azure error is shown as following:

**To Reproduce:**
Please run the demo code as following:
```Typescript
import { BlobServiceClient, StorageSharedKeyCredential } from "@azure/storage-blob";
import * as crypto from "crypto";
async function main(){
const blobServiceClient= new BlobServiceClient("",new StorageSharedKeyCredential("",""));
const containerClient = blobServiceClient.getContainerClient("");
await containerClient.create();
const content = "correct value";
const blockBlobClient = containerClient.getBlockBlobClient("");
const sourceContentMD5 = crypto
.createHash("md5")
.update(Buffer.from("wrong value"))
.digest();
const uploadBlobResponse = await blockBlobClient.upload(content, Buffer.byteLength(content),{blobHTTPHeaders:{blobContentMD5:sourceContentMD5}});
console.log(`Upload block blob ${blobName} successfully`, uploadBlobResponse.requestId);
}
main().catch((err)=>{
console.log(err);
});
```
**Error Track:**
The process code of md5 is shown as following:
[https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlockBlobHandler.ts#L46](https://github.com/Azure/Azurite/blob/master/src/blob/handlers/BlockBlobHandler.ts#L46)


The request doesn't contain `content-md5` when upload a block blob via put blob API.
So as shown, it doesn't use uploaded md5 value to be compared with the md5 value calculated by the server and not return any error.
**Expected Behavior:**
It should return an error `Md5Mismatch` when uploaded md5 value is wrong.
@jongio for notification.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.