mirror of
https://github.com/versity/versitygw.git
synced 2026-07-24 00:52:51 +00:00
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:
co-authored by
Claude Opus 4.8
parent
9f6cb2a760
commit
8a3dbcf97d
@@ -336,9 +336,9 @@ func ListObjectVersions_containing_null_versionId_obj(s *S3Conf) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if getString(out.res.VersionId) != nullVersionId {
|
||||
return fmt.Errorf("expected the uploaded object versionId to be %v, instead got %v",
|
||||
nullVersionId, getString(out.res.VersionId))
|
||||
if out.res.VersionId != nil {
|
||||
return fmt.Errorf("expected PutObject response to omit versionId, instead got %v",
|
||||
getString(out.res.VersionId))
|
||||
}
|
||||
|
||||
versions[0].IsLatest = getBoolPtr(false)
|
||||
|
||||
@@ -64,9 +64,9 @@ func Versioning_PutObject_suspended_null_versionId_obj(s *S3Conf) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if getString(out.res.VersionId) != nullVersionId {
|
||||
return fmt.Errorf("expected the uploaded object versionId to be %v, instead got %v",
|
||||
nullVersionId, getString(out.res.VersionId))
|
||||
if out.res.VersionId != nil {
|
||||
return fmt.Errorf("expected PutObject response to omit versionId, instead got %v",
|
||||
getString(out.res.VersionId))
|
||||
}
|
||||
|
||||
return nil
|
||||
@@ -161,9 +161,9 @@ func Versioning_PutObject_overwrite_null_versionId_obj(s *S3Conf) error {
|
||||
return err
|
||||
}
|
||||
|
||||
if getString(out.res.VersionId) != nullVersionId {
|
||||
return fmt.Errorf("expected the uploaded object versionId to be %v, insted got %v",
|
||||
nullVersionId, getString(out.res.VersionId))
|
||||
if out.res.VersionId != nil {
|
||||
return fmt.Errorf("expected PutObject response to omit versionId, instead got %v",
|
||||
getString(out.res.VersionId))
|
||||
}
|
||||
|
||||
versions[0].IsLatest = getBoolPtr(false)
|
||||
|
||||
Reference in New Issue
Block a user