diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp index 815c5ee2e..5e35b772a 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_file_client.cpp @@ -211,9 +211,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { ret.Details.EncryptionKeySha256 = std::move(response.Value.Details.EncryptionKeySha256); ret.Details.EncryptionScope = std::move(response.Value.Details.EncryptionScope); ret.Details.IsServerEncrypted = response.Value.Details.IsServerEncrypted; - ret.Details.EncryptionContext - = Azure::Core::Http::_internal::HttpShared::GetHeaderOrEmptyString( - response.RawResponse->GetHeaders(), _detail::EncryptionContextHeaderName); + auto& headers = response.RawResponse->GetHeaders(); + auto encryptionContext = headers.find(_detail::EncryptionContextHeaderName); + if (encryptionContext != headers.end()) + { + ret.Details.EncryptionContext = encryptionContext->second; + } return Azure::Response( std::move(ret), std::move(response.RawResponse)); } diff --git a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp index 7c1f390f9..df6532498 100644 --- a/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp +++ b/sdk/storage/azure-storage-files-datalake/src/datalake_path_client.cpp @@ -342,8 +342,12 @@ namespace Azure { namespace Storage { namespace Files { namespace DataLake { ret.VersionId = std::move(response.Value.VersionId); ret.IsCurrentVersion = std::move(response.Value.IsCurrentVersion); ret.IsDirectory = _detail::MetadataIncidatesIsDirectory(ret.Metadata); - ret.EncryptionContext = Azure::Core::Http::_internal::HttpShared::GetHeaderOrEmptyString( - response.RawResponse->GetHeaders(), _detail::EncryptionContextHeaderName); + auto& headers = response.RawResponse->GetHeaders(); + auto encryptionContext = headers.find(_detail::EncryptionContextHeaderName); + if (encryptionContext != headers.end()) + { + ret.EncryptionContext = encryptionContext->second; + } return Azure::Response(std::move(ret), std::move(response.RawResponse)); }