File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed
src/aws-cpp-sdk-core/source/http Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff 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 ();
Original file line number Diff line number Diff 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 ();
You can’t perform that action at this time.
0 commit comments