Handling maxKeys=0 case with a empty response

master
Karthic Rao 9 years ago
parent 2357e00317
commit 99af0444b7
  1. 7
      pkg/fs/fs-bucket-listobjects.go

@ -64,7 +64,12 @@ func (fs Filesystem) ListObjects(bucket, prefix, marker, delimiter string, maxKe
}
}
if maxKeys <= 0 || maxKeys > listObjectsLimit {
// Return empty response for a valid request when maxKeys is 0.
if maxKeys == 0 {
return result, nil
}
if maxKeys < 0 || maxKeys > listObjectsLimit {
maxKeys = listObjectsLimit
}

Loading…
Cancel
Save