Skip to content

Commit

Permalink
parse error
Browse files Browse the repository at this point in the history
  • Loading branch information
jiuker committed May 29, 2024
1 parent 1889034 commit f758d17
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions post-policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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.")

Check failure on line 164 in post-policy.go

View workflow job for this annotation

GitHub Actions / Test on Go 1.21.x and ubuntu-latest

error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)

Check failure on line 164 in post-policy.go

View workflow job for this annotation

GitHub Actions / Test on Go 1.22.x and ubuntu-latest

error-strings: error strings should not be capitalized or end with punctuation or a newline (revive)
}
policyCond := policyCondition{
matchType: "eq",
condition: "$tagging",
Expand Down

0 comments on commit f758d17

Please sign in to comment.