From 2ee913f0cedcb96ffce0b24d100ec4cefcb3215f Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Wed, 28 Oct 2020 19:44:43 +0100 Subject: [PATCH] add multiworld size limit to rolling endpoint --- WebHostLib/generate.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/WebHostLib/generate.py b/WebHostLib/generate.py index 8e04b0b7..c848f213 100644 --- a/WebHostLib/generate.py +++ b/WebHostLib/generate.py @@ -59,6 +59,10 @@ def generate_api(): if json_data: # example: options = {"player1weights" : {}} options = json_data["weights"] + if len(options) > app.config["MAX_ROLL"]: + return {"text": "Max size of multiworld exceeded", + "detail": app.config["MAX_ROLL"]}, 409 + race = bool(json_data["race"]) results, gen_options = roll_yamls(options) if any(type(result) == str for result in results.values()):