mirror of
https://git.wownero.com/lza_menace/suchwow.git
synced 2024-08-15 01:03:19 +00:00
fix query str args for list api
This commit is contained in:
parent
861e355b34
commit
7dffd6e0aa
1 changed files with 7 additions and 1 deletions
|
@ -9,8 +9,14 @@ bp = Blueprint("api", "api")
|
|||
def api_list():
|
||||
limit = request.args.get('limit', 30)
|
||||
offset = request.args.get('offset', 0)
|
||||
if not isinstance(limit, int) or not isinstance(offset, int):
|
||||
|
||||
# Hacky way to convert query str value to int
|
||||
try:
|
||||
limit = int(limit)
|
||||
offset = int(offset)
|
||||
except:
|
||||
abort(500, "Bleep bleep")
|
||||
|
||||
if limit > 30:
|
||||
limit = 30
|
||||
|
||||
|
|
Loading…
Reference in a new issue