From 655ebcdb076ebffed6d09a5b43f0bb70f278bff1 Mon Sep 17 00:00:00 2001 From: Fabian Dill Date: Sun, 26 Sep 2021 06:50:37 +0200 Subject: [PATCH] WebHost: allow .json, .yml on /generate --- WebHostLib/check.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/WebHostLib/check.py b/WebHostLib/check.py index e3657659..8b31ccc3 100644 --- a/WebHostLib/check.py +++ b/WebHostLib/check.py @@ -49,9 +49,7 @@ def get_yaml_data(file) -> Union[Dict[str, str], str]: for file in infolist: if file.filename.endswith(banned_zip_contents): return "Uploaded data contained a rom file, which is likely to contain copyrighted material. Your file was deleted." - elif file.filename.endswith(".yaml"): - options[file.filename] = zfile.open(file, "r").read() - elif file.filename.endswith(".txt"): + elif file.filename.endswith((".yaml", ".json", ".yml", ".txt")): options[file.filename] = zfile.open(file, "r").read() else: options = {file.filename: file.read()}