mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2025-05-08 22:26:04 +02:00
Make sure limit is between 1 and 100
We were not properly checking whether the limit was greater than 0 in all cases.
This commit is contained in:
@ -17,7 +17,7 @@ class AllItemsResource:
|
||||
def on_get(self, req, resp):
|
||||
"""Handles GET requests"""
|
||||
# Return HTTPBadRequest if id parameter is not present and valid
|
||||
limit = req.get_param_as_int("limit", min_value=0, max_value=100) or 100
|
||||
limit = req.get_param_as_int("limit", min_value=1, max_value=100) or 100
|
||||
page = req.get_param_as_int("page", min_value=0) or 0
|
||||
offset = limit * page
|
||||
|
||||
|
Reference in New Issue
Block a user