Skip to content

Commit 85d2f68

Browse files
committed
Skip HEAD for multipart check when multipart_threshold is 0
1 parent f6e0cf3 commit 85d2f68

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: s3transfer/download.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ def _submit(
346346
:param bandwidth_limiter: The bandwidth limiter to use when
347347
downloading streams
348348
"""
349-
if transfer_future.meta.size is None:
349+
if transfer_future.meta.size is None and config.multipart_threshold > 0:
350350
# If a size was not provided figure out the size for the
351351
# user.
352352
response = client.head_object(
@@ -364,7 +364,7 @@ def _submit(
364364

365365
# If it is greater than threshold do a ranged download, otherwise
366366
# do a regular GetObject download.
367-
if transfer_future.meta.size < config.multipart_threshold:
367+
if config.multipart_threshold <= 0 or transfer_future.meta.size < config.multipart_threshold:
368368
self._submit_download_request(
369369
client,
370370
config,

0 commit comments

Comments
 (0)