Skip to content

Commit

Permalink
add content-length even if file size is 0
Browse files Browse the repository at this point in the history
  • Loading branch information
kathia-barahona committed Nov 28, 2023
1 parent ae00595 commit 23ed525
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 23ed525

Please sign in to comment.