From b8fe3c2e5e42276df9532ca1adb9f36977bcc0b7 Mon Sep 17 00:00:00 2001 From: PJ Date: Wed, 11 Sep 2024 09:44:51 +0200 Subject: [PATCH] bus: default limit to -1 --- bus/routes.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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