Open katmsft opened 4 years ago
Azurite targets to align with all public documented behaviors of Azure Storage. prefix
parameter in following document is lowercase.
In https://docs.microsoft.com/en-us/rest/api/storageservices/list-blobs#uri-parameters,
It's un documented behaior that Azure Storage handles prefix
query parameter case insensitively.
We are still thinking what's the best Azurite strategy to align with Azure Storage production especially for the undocumented behaviors.
It's not easy to update in Azurite side to make it case insensitive, because related code are auto generated from predefined swagger, in swagger prefix
parameter is lowercased. We will see how to do that, but it takes time.
In the same time, storage PHP SDK can have take this one line change to unblock customers and align with other Storage SDKs.
@katmsft I agree that a one-to-one behavior would be nice but I also agree with @XiaoningLiu on supporting the documented casing for the query params even though Azure Storage production allows for case-insensitivity unfortunately.
I've sent a PR that just updated the QPs listed in the doc link above but I can dig further into the documentation and update the PR with any other lowercasing that may be needed to match docs if you're willing to merge it.
Thanks!
Well, a fix like this does not work properly, as the QPs are also used in parsing the list result, which by official document should be mixed cases.
See this: https://docs.microsoft.com/en-us/rest/api/storageservices/list-blobs#response-body
Ah, I see, hmm... Nothing is ever easy, ha!
Thoughts on separating that out so that query params can match the lower case per docs and the XML can match the Response Body case per docs?
Something like XTAG_PREVIEW, XTAG_MAX_RESULTS, ...
like others that are defined here.
Only tested the
prefix
but there could be more occurrences. It seems that the query parameter is not case-sensitive for production but is case-sensitive for Azurite, there will be an inconsistent behavior.The HTTP protocol does not guarantee the casing for a query parameter, it is service behavior to ignore case:
Linking to a PHP SDK issue: https://github.com/Azure/azure-storage-php/issues/235