diff --git a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp index a2d73be699..cce269de95 100644 --- a/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp +++ b/sdk/storage/azure-storage-files-datalake/inc/azure/storage/files/datalake/rest_client.hpp @@ -162,7 +162,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * The value of this header is set to true if the contents of the request are successfully * encrypted using the specified algorithm, and false otherwise. */ - Nullable IsServerEncrypted; + bool IsServerEncrypted = bool(); /** * The SHA-256 hash of the encryption key used to encrypt the blob. This header is only * returned when the blob was encrypted with a customer-provided key. @@ -298,7 +298,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * The value of this header is set to true if the contents of the request are successfully * encrypted using the specified algorithm, and false otherwise. */ - Nullable IsServerEncrypted; + bool IsServerEncrypted = bool(); /** * The SHA-256 hash of the encryption key used to encrypt the blob. This header is only * returned when the blob was encrypted with a customer-provided key. @@ -319,7 +319,7 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { * The value of this header is set to true if the contents of the request are successfully * encrypted using the specified algorithm, and false otherwise. */ - Nullable IsServerEncrypted; + bool IsServerEncrypted = bool(); /** * The SHA-256 hash of the encryption key used to encrypt the blob. This header is only * returned when the blob was encrypted with a customer-provided key. diff --git a/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp b/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp index c105e1428a..a88801e2db 100644 --- a/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/rest_client.cpp @@ -691,11 +691,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { response.LastModified = DateTime::Parse( pRawResponse->GetHeaders().at("Last-Modified"), Azure::DateTime::DateFormat::Rfc1123); response.FileSize = std::stoll(pRawResponse->GetHeaders().at("Content-Length")); - if (pRawResponse->GetHeaders().count("x-ms-request-server-encrypted") != 0) - { - response.IsServerEncrypted - = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); - } + response.IsServerEncrypted + = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0) { response.EncryptionKeySha256 = Core::Convert::Base64Decode( @@ -775,11 +772,8 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { = Core::Convert::Base64Decode(pRawResponse->GetHeaders().at("x-ms-content-crc64")); response.TransactionalContentHash.Value().Algorithm = HashAlgorithm::Crc64; } - if (pRawResponse->GetHeaders().count("x-ms-request-server-encrypted") != 0) - { - response.IsServerEncrypted - = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); - } + response.IsServerEncrypted + = pRawResponse->GetHeaders().at("x-ms-request-server-encrypted") == std::string("true"); if (pRawResponse->GetHeaders().count("x-ms-encryption-key-sha256") != 0) { response.EncryptionKeySha256 = Core::Convert::Base64Decode( diff --git a/sdk/storage/azure-storage-files-datalake/swagger/README.md b/sdk/storage/azure-storage-files-datalake/swagger/README.md index b7c915b212..1ff26382ab 100644 --- a/sdk/storage/azure-storage-files-datalake/swagger/README.md +++ b/sdk/storage/azure-storage-files-datalake/swagger/README.md @@ -259,6 +259,7 @@ directive: $["201"].headers["Content-Length"]["x-ms-client-name"] = "FileSize"; $["201"].headers["Content-Length"]["x-nullable"] = true; $["201"].headers["x-ms-request-server-encrypted"]["x-nullable"] = true; + $["201"].headers["x-ms-request-server-encrypted"]["x-ms-client-default"] = "bool()"; $["201"].headers["x-ms-encryption-key-sha256"]["x-nullable"] = true; delete $["201"].headers["x-ms-continuation"]; $["201"].schema = { @@ -436,7 +437,6 @@ directive: $["Content-MD5"]["x-nullable"] = true; $["x-ms-content-crc64"]["x-ms-client-name"] = "TransactionalContentHash"; $["x-ms-content-crc64"]["x-nullable"] = true; - $["x-ms-request-server-encrypted"]["x-nullable"] = true; $["x-ms-encryption-key-sha256"]["x-nullable"] = true; delete $["ETag"]; ``` @@ -449,6 +449,5 @@ directive: where: $["x-ms-paths"]["/{filesystem}/{path}?action=flush"].patch.responses["200"].headers transform: > $["Content-Length"]["x-ms-client-name"] = "FileSize"; - $["x-ms-request-server-encrypted"]["x-nullable"] = true; $["x-ms-encryption-key-sha256"]["x-nullable"] = true; ``` \ No newline at end of file