Skip to content

Commit 58ddd40

Browse files
Max EliaserSergeyRyabinin
Max Eliaser
authored andcommitted
TransferManager: don't set byte range header for 0-byte DoSinglePartDownload
Fixes an issue similar to #738, but which only shows up when using HTTPS endpoints.
1 parent 897cf60 commit 58ddd40

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/aws-cpp-sdk-transfer/source/transfer/TransferManager.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -758,10 +758,13 @@ namespace Aws
758758
auto request = m_transferConfig.getObjectTemplate;
759759
request.SetCustomizedAccessLogTag(m_transferConfig.customizedAccessLogTag);
760760
request.SetContinueRequestHandler([handle](const Aws::Http::HttpRequest*) { return handle->ShouldContinue(); });
761-
request.SetRange(
762-
FormatRangeSpecifier(
763-
handle->GetBytesOffset(),
764-
handle->GetBytesOffset() + handle->GetBytesTotalSize() - 1));
761+
if (handle->GetBytesTotalSize() != 0)
762+
{
763+
request.SetRange(
764+
FormatRangeSpecifier(
765+
handle->GetBytesOffset(),
766+
handle->GetBytesOffset() + handle->GetBytesTotalSize() - 1));
767+
}
765768
request.WithBucket(handle->GetBucketName())
766769
.WithKey(handle->GetKey());
767770

0 commit comments

Comments
 (0)