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

Loading…
Cancel
Save