Skip to content

Commit fb6f349

Browse files
committed
Disable PATCH of empty files by now
1 parent 218f648 commit fb6f349

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

internal/file.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -690,6 +690,8 @@ func (inode *Inode) sendUpload(priority int) bool {
690690
// In current implemetation we should not patch big simple objects. Reupload them as multiparts first.
691691
// If current ETag is unknown, try patching anyway, so that we don't trigger an unecessary mpu.
692692
(inode.uploadedAsMultipart() || inode.knownETag == "" || smallFile) &&
693+
// Current PATCH works incorrectly when updating an empty file. Do not update the empty file using PATCH.
694+
inode.knownSize > 0 &&
693695
// Currently PATCH does not support truncates. If the file was truncated, reupload it.
694696
inode.knownSize <= inode.Attributes.Size
695697

0 commit comments

Comments
 (0)