Skip to content

Commit f2ccf45

Browse files
committed
fix reviews
1 parent eb59649 commit f2ccf45

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/aws-cpp-sdk-core/include/smithy/client/features/ChunkingInterceptor.h

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ namespace features {
1717

1818
namespace {
1919

20+
// String constants
21+
static const char* const CHECKSUM_HEADER_PREFIX = "x-amz-checksum-";
22+
static const char* const ALLOCATION_TAG = "ChunkingInterceptor";
23+
2024
class AwsChunkedStreamBuf : public std::streambuf {
2125
public:
2226
AwsChunkedStreamBuf(Aws::Http::HttpRequest* request, const std::shared_ptr<Aws::IOStream>& originalBody)
@@ -76,7 +80,7 @@ class AWS_CORE_API ChunkingInterceptor : public smithy::interceptor::Interceptor
7680
// Set up chunked encoding headers for checksum calculation
7781
const auto& hashPair = request->GetRequestHash();
7882
if (hashPair.second != nullptr) {
79-
Aws::String checksumHeaderValue = Aws::String("x-amz-checksum-") + hashPair.first;
83+
Aws::String checksumHeaderValue = Aws::String(CHECKSUM_HEADER_PREFIX) + hashPair.first;
8084
request->DeleteHeader(checksumHeaderValue.c_str());
8185
request->SetHeaderValue(Aws::Http::AWS_TRAILER_HEADER, checksumHeaderValue);
8286
request->SetTransferEncoding(Aws::Http::CHUNKED_VALUE);
@@ -97,7 +101,7 @@ class AWS_CORE_API ChunkingInterceptor : public smithy::interceptor::Interceptor
97101
}
98102

99103
auto chunkedBuf = Aws::MakeUnique<AwsChunkedStreamBuf>(
100-
"ChunkingInterceptor", request.get(), originalBody);
104+
ALLOCATION_TAG, request.get(), originalBody);
101105
auto chunkedBody = std::shared_ptr<Aws::IOStream>(
102106
new Aws::IOStream(chunkedBuf.release()));
103107

0 commit comments

Comments
 (0)