Skip to content

Commit

Permalink
Disable PATCH of empty files by now
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalif committed Jan 9, 2025
1 parent 218f648 commit fb6f349
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,8 @@ func (inode *Inode) sendUpload(priority int) bool {
// In current implemetation we should not patch big simple objects. Reupload them as multiparts first.
// If current ETag is unknown, try patching anyway, so that we don't trigger an unecessary mpu.
(inode.uploadedAsMultipart() || inode.knownETag == "" || smallFile) &&
// Current PATCH works incorrectly when updating an empty file. Do not update the empty file using PATCH.
inode.knownSize > 0 &&
// Currently PATCH does not support truncates. If the file was truncated, reupload it.
inode.knownSize <= inode.Attributes.Size

Expand Down

0 comments on commit fb6f349

Please sign in to comment.