[#135] Add max-keys check to ListObjects

Signed-off-by: Angira Kekteeva <kira@nspcc.ru>
This commit is contained in:
Angira Kekteeva 2021-07-06 12:21:31 +03:00
parent cc0e2e7636
commit fd41c325f7

View file

@ -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)
}