From 4f6172f3699cc47107dea3fe4f3664f283296cdb Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Thu, 4 Jan 2024 01:27:13 +0500 Subject: [PATCH] Fix missing VersionConfiguration node in get-bucket-versioning response (#5162) * fix: s3 response for get bucket version https://github.com/seaweedfs/seaweedfs/issues/5155 * fix: s3 response for get bucket version https://github.com/seaweedfs/seaweedfs/issues/5155 --- weed/s3api/s3api_bucket_handlers.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/weed/s3api/s3api_bucket_handlers.go b/weed/s3api/s3api_bucket_handlers.go index c1bb815a9..6ae6011f2 100644 --- a/weed/s3api/s3api_bucket_handlers.go +++ b/weed/s3api/s3api_bucket_handlers.go @@ -545,8 +545,9 @@ func (s3a *S3ApiServer) GetBucketVersioningHandler(w http.ResponseWriter, r *htt return } - result := &s3.VersioningConfiguration{} - result.SetStatus(s3.BucketVersioningStatusSuspended) - - s3err.WriteAwsXMLResponse(w, r, http.StatusOK, result) + s3err.WriteAwsXMLResponse(w, r, http.StatusOK, &s3.PutBucketVersioningInput{ + VersioningConfiguration: &s3.VersioningConfiguration{ + Status: aws.String(s3.BucketVersioningStatusSuspended), + }, + }) }