mirror of
https://git.0x0.st/mia/0x0.git
synced 2026-01-14 14:21:51 +03:00
Open upload blacklist in text mode
This wasn’t working since Flask opens files in bin mode by default.
This commit is contained in:
2
fhost.py
2
fhost.py
@@ -251,7 +251,7 @@ def shorten(url):
|
|||||||
|
|
||||||
def in_upload_bl(addr):
|
def in_upload_bl(addr):
|
||||||
if app.config["FHOST_UPLOAD_BLACKLIST"]:
|
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:")
|
check = addr.lstrip("::ffff:")
|
||||||
for l in bl.readlines():
|
for l in bl.readlines():
|
||||||
if not l.startswith("#"):
|
if not l.startswith("#"):
|
||||||
|
|||||||
Reference in New Issue
Block a user