From fd41c325f770ee388364debb5e8dfa0f77f9d8ce Mon Sep 17 00:00:00 2001 From: Angira Kekteeva Date: Tue, 6 Jul 2021 12:21:31 +0300 Subject: [PATCH] [#135] Add max-keys check to ListObjects Signed-off-by: Angira Kekteeva --- api/handler/list.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/handler/list.go b/api/handler/list.go index ec55228ae..e58a4b160 100644 --- a/api/handler/list.go +++ b/api/handler/list.go @@ -276,7 +276,7 @@ func parseListObjectArgs(r *http.Request) (*listObjectsArgs, error) { if r.URL.Query().Get("max-keys") == "" { res.MaxKeys = maxObjectList - } else if res.MaxKeys, err = strconv.Atoi(r.URL.Query().Get("max-keys")); err != nil { + } else if res.MaxKeys, err = strconv.Atoi(r.URL.Query().Get("max-keys")); err != nil || res.MaxKeys <= 0 { return nil, api.GetAPIError(api.ErrInvalidMaxKeys) }