diff --git a/weed/s3api/tags.go b/weed/s3api/tags.go index 0fc32241f..3df44fae0 100644 --- a/weed/s3api/tags.go +++ b/weed/s3api/tags.go @@ -5,6 +5,7 @@ import ( "fmt" "github.com/seaweedfs/seaweedfs/weed/util" "regexp" + "sort" "strings" ) @@ -39,6 +40,11 @@ func FromTags(tags map[string]string) (t *Tagging) { Value: v, }) } + if tagArr := t.TagSet.Tag; len(tagArr) > 0 { + sort.SliceStable(tagArr, func(i, j int) bool { + return tagArr[i].Key < tagArr[j].Key + }) + } return }