Browse Source

always sort

pull/7481/head
chrislu 1 month ago
parent
commit
cd0e1ad14b
  1. 4
      weed/s3api/s3api_object_handlers_list.go

4
weed/s3api/s3api_object_handlers_list.go

@ -351,9 +351,9 @@ func (s3a *S3ApiServer) listFilerEntries(bucket string, originalPrefix string, m
Contents: contents, Contents: contents,
CommonPrefixes: commonPrefixes, CommonPrefixes: commonPrefixes,
} }
// Sort CommonPrefixes lexicographically to match AWS S3 behavior
sort.Slice(response.CommonPrefixes, func(i, j int) bool { return response.CommonPrefixes[i].Prefix < response.CommonPrefixes[j].Prefix })
if encodingTypeUrl { if encodingTypeUrl {
// Sort CommonPrefixes lexicographically to match AWS S3 behavior
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