serve s3: fix overwrite of files with 0 length file

Before this change overwriting an existing file with a 0 length file
didn't update the file size.

This change corrects the issue and makes sure the file is truncated
properly.

This was discovered by the full integration tests.
This commit is contained in:
Nick Craig-Wood 2023-11-24 17:43:06 +00:00
parent aaa897337d
commit 0244caf13a

View file

@ -282,11 +282,6 @@ func (b *s3Backend) PutObject(
}
}
if size == 0 {
// maybe a touch operation
return b.TouchObject(fp, meta)
}
f, err := b.vfs.Create(fp)
if err != nil {
return result, err