Skip to content

Commit

Permalink
Merge pull request #449 from versity/ben/input_tag_format
Browse files Browse the repository at this point in the history
fix: remove namespace restrictions on tag xml input
  • Loading branch information
benmcclelland authored Mar 12, 2024
2 parents d7ef238 + 0d8a4f5 commit b801a70
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s3api/controllers/base.go
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ func (c S3ApiController) PutBucketActions(ctx *fiber.Ctx) error {
if ctx.Request().URI().QueryArgs().Has("tagging") {
parsedAcl := ctx.Locals("parsedAcl").(auth.ACL)

var bucketTagging s3response.Tagging
var bucketTagging s3response.TaggingInput
err := xml.Unmarshal(ctx.Body(), &bucketTagging)
if err != nil {
return SendResponse(ctx, s3err.GetAPIError(s3err.ErrInvalidRequest),
Expand Down Expand Up @@ -925,7 +925,7 @@ func (c S3ApiController) PutActions(ctx *fiber.Ctx) error {
}

if ctx.Request().URI().QueryArgs().Has("tagging") {
var objTagging s3response.Tagging
var objTagging s3response.TaggingInput
err := xml.Unmarshal(ctx.Body(), &objTagging)
if err != nil {
return SendResponse(ctx, s3err.GetAPIError(s3err.ErrInvalidRequest),
Expand Down
4 changes: 4 additions & 0 deletions s3response/s3response.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,10 @@ type Tagging struct {
TagSet TagSet `xml:"TagSet"`
}

type TaggingInput struct {
TagSet TagSet `xml:"TagSet"`
}

type DeleteObjects struct {
Objects []types.ObjectIdentifier `xml:"Object"`
}
Expand Down

0 comments on commit b801a70

Please sign in to comment.