Seems metadata needs to be prefixed with x-ms-meta-
because of strip_prefix()
#2289
Open
3 tasks done
Labels
customer-reported
Issues that are reported by GitHub users external to the Azure organization.
question
The issue doesn't require a change to the product in order to be resolved. Most issues start as that
Storage
Storage Service (Queues, Blobs, Files)
Bug Title
impl From<&Headers> for Metadata
seems to require header keys to be prefixed withx-ms-meta-
Crate Name
azure_storage
Crate Version
0.21.0
Description
While trying to add metadata to a storage container using
Headers
, it seems that any header keys not starting withx-ms-meta-
are not add populated intoMetadata
inimpl From<&Headers> for Metadata
.Crate code:
reference:
azure-sdk-for-rust/sdk/core/azure_core/src/request_options/metadata.rs
Line 83 in 51f94b1
I am not sure whether it's bug or expected behavior? But
strip_prefix("x-ms-meta-")
returnsNone
if input doesn't contain the prefix.I would assume this code is just meant to strip this prefix if exists otherwise uses the key as is as it's done / possible via UI:
If this behavior is not expected, I would suggest to change
impl From<&Headers> for Metadata
implementation to this one:Happy to send a PR to fix this one if you consider it to be a bug.
Steps to Reproduce
Here's the code to reproduce the issue:
"x-ms-meta-"
:"x-ms-meta-"
:label-1
andlabel-2
.Checklist
The text was updated successfully, but these errors were encountered: