From 5216e9ebaf7046d06afa6273c33b4fa0b1f53ceb Mon Sep 17 00:00:00 2001 From: Mia Herkt Date: Mon, 1 Aug 2022 18:26:35 +0200 Subject: [PATCH] Open upload blacklist in text mode MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This wasn’t working since Flask opens files in bin mode by default. --- fhost.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fhost.py b/fhost.py index 8e5b100..2703810 100755 --- a/fhost.py +++ b/fhost.py @@ -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("#"):