mirror of
https://github.com/versity/versitygw.git
synced 2026-01-03 10:35:15 +00:00
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:
@@ -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{
|
||||
|
||||
Reference in New Issue
Block a user