Skip to content

Commit

Permalink
Merge pull request #607 from Aiven-Open/kathiabarahona/uploading_empt…
Browse files Browse the repository at this point in the history
…y_file

add content-length even if file size is 0
  • Loading branch information
rdunklau authored Nov 28, 2023
2 parents ae00595 + 23ed525 commit 8a2d730
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pghoard/transfer.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ def handle_upload(self, site, key, file_to_transfer: UploadEvent):
f = open(file_to_transfer.source_data, "rb")
with f:
metadata = file_to_transfer.metadata.copy()
if file_to_transfer.file_size:
if file_to_transfer.file_size is not None:
metadata["Content-Length"] = str(file_to_transfer.file_size)
storage.store_file_object(
key, f, metadata=metadata, upload_progress_fn=file_to_transfer.incremental_progress_callback
Expand Down

0 comments on commit 8a2d730

Please sign in to comment.