this.Metadata = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
We came across this issue, when our client library uploaded a blob where the metadata key was lowercase (e.g. "mymetadatakey") and our server tried to access the metadata:
blob.Metadata.TryGetValue("MyMetadataKey", out var metaDataValue)
This call wasn't successful, since the dictionary uses the default comparer and therefore the value can't be retrieved.
Since the metadata of a blob are just a bunch of HTTP headers, shouldn't they be case-insensitive (see https://stackoverflow.com/questions/5258977/are-http-headers-case-sensitive )?
Therefore the metadata dictionary: https://github.com/Azure/azure-storage-net/blob/c1966e1cd64d5eb8e40733ebd6b07b6b8e8fb136/Lib/Common/Blob/BlobAttributes.cs#L30 should have a case-insensitive comparer:
We came across this issue, when our client library uploaded a blob where the metadata key was lowercase (e.g. "mymetadatakey") and our server tried to access the metadata:
This call wasn't successful, since the dictionary uses the default comparer and therefore the value can't be retrieved.
Even the official documentation (https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata ) states:
So if the read/writes are case-insensitive, shouldn't the library behave this way?