diff --git a/bus/routes.go b/bus/routes.go index 33559ee98..040f241aa 100644 --- a/bus/routes.go +++ b/bus/routes.go @@ -1351,7 +1351,11 @@ func (b *Bus) objectsListHandlerPOST(jc jape.Context) { if jc.Decode(&req) != nil { return } - resp, err := b.ms.ListObjects(jc.Request.Context(), req.Bucket, req.SlabKey, req.Prefix, req.SortBy, req.SortDir, req.Marker, req.Limit) + limit := -1 + if req.Limit > 0 { + limit = req.Limit + } + resp, err := b.ms.ListObjects(jc.Request.Context(), req.Bucket, req.SlabKey, req.Prefix, req.SortBy, req.SortDir, req.Marker, limit) if errors.Is(err, api.ErrMarkerNotFound) { jc.Error(err, http.StatusBadRequest) return