Skip to content

Commit 50d56e9

Browse files
sbera87sbiscigl
authored andcommitted
Pick hash algorithm from http response header
1 parent 13d9a7d commit 50d56e9

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,13 @@ static size_t WriteData(char* ptr, size_t size, size_t nmemb, void* userdata)
214214

215215
for (const auto& hashIterator : context->m_request->GetResponseValidationHashes())
216216
{
217+
std::stringstream headerStr;
218+
headerStr<<"x-amz-checksum-"<<hashIterator.first;
219+
if(context->m_response->HasHeader(headerStr.str().c_str()))
220+
{
217221
hashIterator.second->Update(reinterpret_cast<unsigned char*>(ptr), sizeToWrite);
222+
break;
223+
}
218224
}
219225

220226
if (response->GetResponseBody().fail()) {

0 commit comments

Comments
 (0)