Azure / Azurite

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

Uploading blob metadata with invalid key should fail #399

Open mattdurak opened 4 years ago

mattdurak commented 4 years ago

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

Blob

Which version of the Azurite was used?

3.4.0

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

npm

What's the Node.js version?

v11.10.0

What problem was encountered?

When I try to add metadata to a blob where the key is something that is not valid (e.g. the string "1"), I expect the upload of the metadata to fail. It does not when using Azurite, but the old Azure Storage Emulator had the correct behavior.

Steps to reproduce the issue?

Create blob. Set the metadata as key:"1", value:"value". Upload metadata. Expect that the call fails, but it seems to succeed.

Have you found a mitigation/solution?

Disabling the test we have in our code for now.

XiaoningLiu commented 4 years ago

Hi @mattdurak Thanks for bringing this! Curious which test covers this? Will check in following releases.

https://docs.microsoft.com/en-us/rest/api/storageservices/set-blob-metadata metadata names must adhere to the naming rules for C# identifiers.

mattdurak commented 4 years ago

We have a test in our own code for this. I found that if I try to upload metadata with the key "1" it succeeds (I expect it to fail), but if I do something like key "?1" then it fails (but I haven't looked closely if it's the SDK or the Azurite server)