This commit is contained in:
Ocheretovich 2026-05-14 18:32:50 +08:00 committed by GitHub
commit fd31a710d6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -890,11 +890,19 @@ class PromptServer():
async def get_history(request):
max_items = request.rel_url.query.get("max_items", None)
if max_items is not None:
max_items = int(max_items)
try:
max_items = int(max_items)
if max_items <= 0:
return web.json_response({"error": "max_items must be a positive integer"}, status=400)
except (ValueError, TypeError):
return web.json_response({"error": "max_items must be an integer"}, status=400)
offset = request.rel_url.query.get("offset", None)
if offset is not None:
offset = int(offset)
try:
offset = int(offset)
except (ValueError, TypeError):
return web.json_response({"error": "offset must be an integer"}, status=400)
else:
offset = -1