fix: omit null version id for suspended buckets

Keep null as the stored object version ID when bucket versioning is suspended, but omit x-amz-version-id from the PutObject response to match Amazon S3.

Update the existing versioning integration coverage to distinguish the PutObject response from the null version returned by ListObjectVersions, and verify empty response headers are not rendered.

Fixes #2164

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
hgichon
2026-07-14 19:21:20 -07:00
committed by GitHub
co-authored by Claude Opus 4.8
parent 9f6cb2a760
commit 8a3dbcf97d
4 changed files with 24 additions and 13 deletions
+6
View File
@@ -3938,6 +3938,12 @@ func (p *Posix) PutObjectWithPostFunc(ctx context.Context, po s3response.PutObje
}
}
// "null" identifies the current object internally while versioning is
// suspended, but S3 omits the version ID from the PutObject response.
if versionID == nullVersionId {
versionID = ""
}
err = postprocess(f.File())
if err != nil {
return s3response.PutObjectOutput{},