From 2b7a71568ce00835646ea04f85fb38ef4971a630 Mon Sep 17 00:00:00 2001 From: niksis02 Date: Tue, 8 Apr 2025 18:26:26 +0400 Subject: [PATCH] fix: Changes the GetObjectLegalHold result root tag to LegalHold Fixes #1193 Changes the xml root tag element to `LegalHold` in `GetObjectLegalHold` response. --- auth/object_lock.go | 6 +++--- s3response/s3response.go | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/auth/object_lock.go b/auth/object_lock.go index 8abfa8d..4001011 100644 --- a/auth/object_lock.go +++ b/auth/object_lock.go @@ -120,18 +120,18 @@ func ParseObjectLockRetentionOutput(input []byte) (*types.ObjectLockRetention, e return &retention, nil } -func ParseObjectLegalHoldOutput(status *bool) *types.ObjectLockLegalHold { +func ParseObjectLegalHoldOutput(status *bool) *s3response.GetObjectLegalHoldResult { if status == nil { return nil } if *status { - return &types.ObjectLockLegalHold{ + return &s3response.GetObjectLegalHoldResult{ Status: types.ObjectLockLegalHoldStatusOn, } } - return &types.ObjectLockLegalHold{ + return &s3response.GetObjectLegalHoldResult{ Status: types.ObjectLockLegalHoldStatusOff, } } diff --git a/s3response/s3response.go b/s3response/s3response.go index 111cfb4..400df7a 100644 --- a/s3response/s3response.go +++ b/s3response/s3response.go @@ -571,6 +571,11 @@ type CopyObjectInput struct { TaggingDirective types.TaggingDirective } +type GetObjectLegalHoldResult struct { + XMLName xml.Name `xml:"http://s3.amazonaws.com/doc/2006-03-01/ LegalHold"` + Status types.ObjectLockLegalHoldStatus +} + type AmzDate struct { time.Time }