add multiworld size limit to rolling endpoint

This commit is contained in:
Fabian Dill 2020-10-28 19:44:43 +01:00
parent 1afdd473ca
commit 2ee913f0ce
1 changed files with 4 additions and 0 deletions

View File

@ -59,6 +59,10 @@ def generate_api():
if json_data:
# example: options = {"player1weights" : {<weightsdata>}}
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()):