Fix Share Client failure #4377 (#4381)

* Fix Share Client failure #4377
This commit is contained in:
microzchang 2023-02-23 18:14:41 -08:00 committed by GitHub
parent 1df70cb104
commit 71a7cfb0c1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 16 additions and 4 deletions

View File

@ -2,5 +2,5 @@
"AssetsRepo": "Azure/azure-sdk-assets",
"AssetsRepoPrefixPath": "cpp",
"TagPrefix": "cpp/storage",
"Tag": "cpp/storage_925cef0316"
"Tag": "cpp/storage_92d8f38118"
}

View File

@ -1652,9 +1652,15 @@ namespace Azure { namespace Storage { namespace Files { namespace Shares {
}
}
}
response.ETag = ETag(pRawResponse->GetHeaders().at("ETag"));
response.LastModified = DateTime::Parse(
pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123);
if (pRawResponse->GetHeaders().count("ETag") != 0)
{
response.ETag = ETag(pRawResponse->GetHeaders().at("ETag"));
}
if (pRawResponse->GetHeaders().count("Last-Modified") != 0)
{
response.LastModified = DateTime::Parse(
pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123);
}
return Response<Models::ShareStatistics>(std::move(response), std::move(pRawResponse));
}
Response<Models::CreateDirectoryResult> DirectoryClient::Create(

View File

@ -378,6 +378,10 @@ directive:
- from: swagger-document
where: $["x-ms-paths"]["/{shareName}?restype=share&comp=stats"].get.responses["200"]
transform: >
$.headers["ETag"]["x-ms-client-default"] = "";
$.headers["ETag"]["x-nullable"] = true;
$.headers["Last-Modified"]["x-ms-client-default"] = "";
$.headers["Last-Modified"]["x-nullable"] = true;
$.schema = {
"description": "Stats for the share.",
"type": "object",

View File

@ -529,6 +529,8 @@ namespace Azure { namespace Storage { namespace Test {
}
}
TEST_F(FileShareClientTest, GetStatistics) { EXPECT_NO_THROW(m_shareClient->GetStatistics()); }
TEST_F(FileShareClientTest, PremiumShare)
{
auto shareClientOptions = InitStorageClientOptions<Files::Shares::ShareClientOptions>();