diff --git a/src/aws-cpp-sdk-core/source/http/crt/CRTHttpClient.cpp b/src/aws-cpp-sdk-core/source/http/crt/CRTHttpClient.cpp index c007cf6d256..4c392bdf280 100644 --- a/src/aws-cpp-sdk-core/source/http/crt/CRTHttpClient.cpp +++ b/src/aws-cpp-sdk-core/source/http/crt/CRTHttpClient.cpp @@ -246,13 +246,19 @@ namespace Aws } //TODO: handle the read rate limiter here, once back pressure is setup. + assert(response); for (const auto& hashIterator : request->GetResponseValidationHashes()) { + std::stringstream headerStr; + headerStr<<"x-amz-checksum-"<HasHeader(headerStr.str().c_str())) + { hashIterator.second->Update(reinterpret_cast(body.ptr), body.len); + break; + } } // When data is received from the content body of the incoming response, just copy it to the output stream. - assert(response); response->GetResponseBody().write((const char*)body.ptr, static_cast(body.len)); if (response->GetResponseBody().fail()) { const auto& ref = response->GetResponseBody(); diff --git a/src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp b/src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp index 35c718458d5..6f61eeee133 100644 --- a/src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp +++ b/src/aws-cpp-sdk-core/source/http/curl/CurlHttpClient.cpp @@ -214,7 +214,13 @@ static size_t WriteData(char* ptr, size_t size, size_t nmemb, void* userdata) for (const auto& hashIterator : context->m_request->GetResponseValidationHashes()) { + std::stringstream headerStr; + headerStr<<"x-amz-checksum-"<m_response->HasHeader(headerStr.str().c_str())) + { hashIterator.second->Update(reinterpret_cast(ptr), sizeToWrite); + break; + } } if (response->GetResponseBody().fail()) { diff --git a/src/aws-cpp-sdk-core/source/http/windows/WinSyncHttpClient.cpp b/src/aws-cpp-sdk-core/source/http/windows/WinSyncHttpClient.cpp index b76ff25583a..cda0078abeb 100644 --- a/src/aws-cpp-sdk-core/source/http/windows/WinSyncHttpClient.cpp +++ b/src/aws-cpp-sdk-core/source/http/windows/WinSyncHttpClient.cpp @@ -287,7 +287,13 @@ bool WinSyncHttpClient::BuildSuccessResponse(const std::shared_ptr& { for (const auto& hashIterator : request->GetResponseValidationHashes()) { + std::stringstream headerStr; + headerStr<<"x-amz-checksum-"<HasHeader(headerStr.str().c_str())) + { hashIterator.second->Update(reinterpret_cast(dst), static_cast(read)); + break; + } } auto& headersHandler = request->GetHeadersReceivedEventHandler();