Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

stageBlock API does not return Content-MD5

spintower opened this issue · comments

Which service(blob, file, queue, table) does this issue concern?

Blob

Which version of the Azurite was used?

3.30.0

Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)

DockerHub

What's the Node.js version?

embedded in container

What problem was encountered?

stageBlock API always returns null in Content-MD5 header.

Steps to reproduce the issue?

Invoke stageBlock API. Content-MD5 header is always null.

INFO ROOT -- {cf1a7f88-2fda-496d-b078-e9a7cbbb8617}: {Starting request to 'https://127.0.0.1:10000/account2/test-container/test-data/4123905f-3265-492b-a6e9-198570d5ea4d?blockid=IjB4MjU2MzI1RUVFMDE0NTQwIi0wMDAwMA%3D%3D&comp=block' at 'Fri, 03 May 2024 18:11:45 GMT'.}
...
INFO ROOT -- {cf1a7f88-2fda-496d-b078-e9a7cbbb8617}: {Response received. Status code = '201', Request ID = '87e6a807-9767-4127-aefc-086bbdcdc162', Content-MD5 = 'null', ETag = 'null', Date = 'Fri, 03 May 2024 18:11:45 GMT'.}

Looks like this is marked TODO in the code:

https://github.com/Azure/Azurite/blob/main/src/blob/handlers/BlockBlobHandler.ts#L255

Have you found a mitigation/solution?

Maybe change line 255 to use calculatedContentMD5?

contentMD5: calculatedContentMD5

@EmmaZhu
Would you please help to look?