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

3
run.py
View File

@ -61,6 +61,9 @@ def error_page(error, code):
def allowed_file(filename):
if config["ALLOW_ALL_FILES"]:
return True
else:
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"]