From 4acfd4d823dbe8ff2a90c5aab48b5aee4684ffb4 Mon Sep 17 00:00:00 2001 From: "Dominik V. Salonen" Date: Fri, 23 Dec 2016 09:31:04 +0100 Subject: [PATCH] Add blacklist support plz work --- run.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 0d23de5..6c7cfc1 100755 --- a/run.py +++ b/run.py @@ -62,7 +62,10 @@ def allowed_file(filename): if config["ALLOW_ALL_FILES"]: return True else: - return '.' in filename and filename.rsplit('.', 1)[1] in config["ALLOWED_EXTENSIONS"] + if config["BLACKLIST"]: + return '.' in filename and filename.rsplit('.', 1)[1] in config["BANNED_EXTENSIONS"] + else: + return '.' in filename and filename.rsplit('.', 1)[1] in config["ALLOWED_EXTENSIONS"] @app.route('/', methods=['GET', 'POST'])