From f758d177456caf75f6e77c81a80467ebf5f29cc4 Mon Sep 17 00:00:00 2001 From: jiuker <2818723467@qq.com> Date: Wed, 29 May 2024 16:46:06 +0800 Subject: [PATCH] parse error --- post-policy.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/post-policy.go b/post-policy.go index 6d42488e5..4cc9e24d5 100644 --- a/post-policy.go +++ b/post-policy.go @@ -19,12 +19,14 @@ package minio import ( "encoding/base64" + "errors" "fmt" "net/http" "strings" "time" "github.com/minio/minio-go/v7/pkg/encrypt" + "github.com/minio/minio-go/v7/pkg/tags" ) // expirationDateFormat date format for expiration key in json policy. @@ -157,6 +159,10 @@ func (p *PostPolicy) SetTagging(tagging string) error { if strings.TrimSpace(tagging) == "" || tagging == "" { return errInvalidArgument("No tagging specified.") } + _, err := tags.ParseObjectXML(strings.NewReader(tagging)) + if err != nil { + return errors.New("The XML you provided was not well-formed or did not validate against our published schema.") + } policyCond := policyCondition{ matchType: "eq", condition: "$tagging",