Skip to content

Commit

Permalink
bus: default limit to -1
Browse files Browse the repository at this point in the history
  • Loading branch information
peterjan committed Sep 11, 2024
1 parent 75b29fe commit b8fe3c2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bus/routes.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b8fe3c2

Please sign in to comment.