fix: s3proxy list object returns invalid response

Updated the convertObjects function to initialize the result slice
with a length of 0 and a capacity equal to the length of the input
slice (objs).

This fixes the problem where the results were being appended to
a slice that already contained 0 value entries for the
preallocated length.
This commit is contained in:
Ben McClelland
2025-02-26 15:11:44 -08:00
parent 704d6a3cd4
commit f7277e4274

View File

@@ -898,7 +898,7 @@ func base64Decode(encoded string) ([]byte, error) {
}
func convertObjects(objs []types.Object) []s3response.Object {
result := make([]s3response.Object, len(objs))
result := make([]s3response.Object, 0, len(objs))
for _, obj := range objs {
result = append(result, s3response.Object{