Azure / Azurite

A lightweight server clone of Azure Storage that simulates most of the commands supported by it with minimal dependencies
MIT License
1.83k stars 324 forks source link

[Blob] Content-Encoding property missing from blob list items #1698

Closed roelarents closed 2 years ago

roelarents commented 2 years ago

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

blob

Which version of the Azurite was used?

v3.19.0

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

dockerhub or github (self build)

What's the Node.js version?

v14.17.0

What problem was encountered?

Some properties are missing compared to Azure in the blob items in the response for the blob list endpoint. E.g. Content-Encoding.

The API spec lists these properties as included. This "inconsistency" with Azure causes a problem for e.g. minio azure gateway which expects Content-Encoding to be present.

Steps to reproduce the issue?

Have you found a mitigation/solution?

I think the solution is somewhere in the XML serializer and/or the mapping for the BlobProperties. But that code is generated from the swagger specs (which I cannot find) with a private generator, as stated in the readme. I could explicitly add the properties empty/undefined in the listBlobHierarchySegment function. But they are removed somewhere in the serializer.

blueww commented 2 years ago

@roelarents

From the swagger spec in link <Content-Encoding/> and <Content-Language/> are not required in the list blob responds. (only Etag and LastModified are required.) So Azurite will only add them when they really have value.

We have discussed a similar issue for "Content-MD5" with server team before, and get : "I think, empty element or absence of element should mean the same. Clients should be resilient while parsing XML response." That issue is for JS SDK, and finally JSD SDK is fixed to handle this kind of responds.

So this looks a client issue which can't handle the absence of these optional properties. Would you like to contact the client team to fix the client side?

roelarents commented 2 years ago

Thanks for pointing to the swagger spec and the similar issue. You are right. So I'll close this issue. The client in question (minio azure gateway) unfortunately abandoned that functionality recently so I cannot change it there. But that's not your problem :). We'll find a workaround or other solution.