Skip to content

Commit 447f0fc

Browse files
committed
apply change to other http clients
1 parent 50d56e9 commit 447f0fc

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

src/aws-cpp-sdk-core/source/http/crt/CRTHttpClient.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,13 +246,19 @@ namespace Aws
246246
}
247247

248248
//TODO: handle the read rate limiter here, once back pressure is setup.
249+
assert(response);
249250
for (const auto& hashIterator : request->GetResponseValidationHashes())
250251
{
252+
std::stringstream headerStr;
253+
headerStr<<"x-amz-checksum-"<<hashIterator.first;
254+
if(response->HasHeader(headerStr.str().c_str()))
255+
{
251256
hashIterator.second->Update(reinterpret_cast<unsigned char*>(body.ptr), body.len);
257+
break;
258+
}
252259
}
253260

254261
// When data is received from the content body of the incoming response, just copy it to the output stream.
255-
assert(response);
256262
response->GetResponseBody().write((const char*)body.ptr, static_cast<long>(body.len));
257263
if (response->GetResponseBody().fail()) {
258264
const auto& ref = response->GetResponseBody();

src/aws-cpp-sdk-core/source/http/windows/WinSyncHttpClient.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,13 @@ bool WinSyncHttpClient::BuildSuccessResponse(const std::shared_ptr<HttpRequest>&
287287
{
288288
for (const auto& hashIterator : request->GetResponseValidationHashes())
289289
{
290+
std::stringstream headerStr;
291+
headerStr<<"x-amz-checksum-"<<hashIterator.first;
292+
if(response->HasHeader(headerStr.str().c_str()))
293+
{
290294
hashIterator.second->Update(reinterpret_cast<unsigned char*>(dst), static_cast<size_t>(read));
295+
break;
296+
}
291297
}
292298

293299
auto& headersHandler = request->GetHeadersReceivedEventHandler();

0 commit comments

Comments
 (0)