1
0
Fork 0
forked from mia/0x0

Open upload blacklist in text mode

This wasn’t working since Flask opens files in bin mode by default.
This commit is contained in:
Mia Herkt 2022-08-01 18:26:35 +02:00
parent 0db6e4b895
commit 5216e9ebaf
No known key found for this signature in database
GPG key ID: 72E154B8622EC191

View file

@ -251,7 +251,7 @@ def shorten(url):
def in_upload_bl(addr):
if app.config["FHOST_UPLOAD_BLACKLIST"]:
with app.open_instance_resource(app.config["FHOST_UPLOAD_BLACKLIST"]) as bl:
with app.open_instance_resource(app.config["FHOST_UPLOAD_BLACKLIST"], "r") as bl:
check = addr.lstrip("::ffff:")
for l in bl.readlines():
if not l.startswith("#"):