Skip to content

Commit

Permalink
Skip HEAD for multipart check when multipart_threshold is None
Browse files Browse the repository at this point in the history
  • Loading branch information
daveisfera committed Oct 17, 2024
1 parent f6e0cf3 commit 7f69e3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s3transfer/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ def _submit(
:param bandwidth_limiter: The bandwidth limiter to use when
downloading streams
"""
if transfer_future.meta.size is None:
if transfer_future.meta.size is None and config.multipart_threshold is not None:
# If a size was not provided figure out the size for the
# user.
response = client.head_object(
Expand All @@ -364,7 +364,7 @@ def _submit(

# If it is greater than threshold do a ranged download, otherwise
# do a regular GetObject download.
if transfer_future.meta.size < config.multipart_threshold:
if config.multipart_threshold is None or transfer_future.meta.size < config.multipart_threshold:
self._submit_download_request(
client,
config,
Expand Down

0 comments on commit 7f69e3a

Please sign in to comment.