Content-MD5 should always be returned when listing blobs
See original GitHub issueWhich service(blob, file, queue, table) does this issue concern?
blob
Which version of the Azurite was used?
3.14.0
Where do you get Azurite? (npm, DockerHub, NuGet, Visual Studio Code Extension)
npm
What’s the Node.js version?
16.13.1
What problem was encountered?
When listing blobs, it occasionally return blobs without a Content-MD5 property in the XML response if the MD5 is empty. Maybe having an empty MD5 value is not the exact cause but that’s my observation so far.
Steps to reproduce the issue?
Upload an append blob to azurite instance with an empty MD5 value. Try to list the blob container which should return that blob.
In the response, the Content-MD5 property is missing.
Actual response:
<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="" ContainerName="">
<MaxResults>1000</MaxResults>
<Delimiter>/</Delimiter>
<Blobs>
<Blob>
<Name>blob</Name>
<Properties>
<Creation-Time>Thu, 11 Mar 2021 23:09:53 GMT</Creation-Time>
<Last-Modified>Sat, 07 Aug 2021 00:19:39 GMT</Last…>
<Content-CRC64 />
<Cache-Control />
<Content-Disposition />
<BlobType>BlockBlob</BlobType>
<AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted>
</Properties>
<Metadata />
<OrMetadata />
</Blob>
</Blobs>
<NextMarker />
</EnumerationResults>
Expected response:
<?xml version="1.0" encoding="utf-8"?>
<EnumerationResults ServiceEndpoint="" ContainerName="">
<MaxResults>1000</MaxResults>
<Delimiter>/</Delimiter>
<Blobs>
<Blob>
<Name>blob</Name>
<Properties>
<Creation-Time>Thu, 11 Mar 2021 23:09:53 GMT</Creation-Time>
<Last-Modified>Sat, 07 Aug 2021 00:19:39 GMT</Last…>
<Content-CRC64 />
<Content-MD5/> ------------------> This is missing
<Cache-Control />
<Content-Disposition />
<BlobType>BlockBlob</BlobType>
<AccessTier>Hot</AccessTier>
<AccessTierInferred>true</AccessTierInferred>
<LeaseStatus>unlocked</LeaseStatus>
<LeaseState>available</LeaseState>
<ServerEncrypted>true</ServerEncrypted>
</Properties>
<Metadata />
<OrMetadata />
</Blob>
</Blobs>
<NextMarker />
</EnumerationResults>
The public Azure blob service always returns the empty Content-MD5 in its list blob responses.
Have you found a mitigation/solution?
People can manually parse the response and handle that. However, the @azure/storage-blob sdk currently cannot handle this situation because it uses NodeJS standard library to process that property value which will throw if the value is undefined. Due to that, such blob can cause the SDK to not be able to list any blobs if the response contains those problematic blobs.
Issue Analytics
- State:
- Created a year ago
- Comments:8 (5 by maintainers)
Top GitHub Comments
[Wei] in the blob rest API doc, it says
So I believe this is expected contentMD5 is not required.
Close this issue as JS SDK is already fixed.