Browse Source

fix test_bucket_listv2_encoding_basic

pull/5580/head
Konstantin Lebedev 8 months ago
parent
commit
46731af1d8
  1. 5
      weed/s3api/s3api_object_handlers_list.go

5
weed/s3api/s3api_object_handlers_list.go

@ -12,6 +12,7 @@ import (
"io"
"net/http"
"net/url"
"sort"
"strconv"
"strings"
)
@ -148,6 +149,7 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
maxKeys: maxKeys,
prefixEndsOnDelimiter: strings.HasSuffix(originalPrefix, "/") && len(originalMarker) == 0,
}
// Todo remove force disable
if s3a.option.AllowListRecursive && prefix == "force_disable" {
err = s3a.WithFilerClient(false, func(client filer_pb.SeaweedFilerClient) error {
@ -274,6 +276,9 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
CommonPrefixes: commonPrefixes,
}
if encodingTypeUrl {
sort.Slice(response.CommonPrefixes, func(i, j int) bool {
return response.CommonPrefixes[i].Prefix < response.CommonPrefixes[j].Prefix
})
response.EncodingType = s3.EncodingTypeUrl
}
return nil

Loading…
Cancel
Save