Add blacklist support

plz work
This commit is contained in:
Dominik V. Salonen 2016-12-23 09:31:04 +01:00 committed by GitHub
parent 36e2dad270
commit 4acfd4d823
1 changed files with 4 additions and 1 deletions

5
run.py
View File

@ -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'])