From d04c1704667183f1e2e31fb48e00265de6228182 Mon Sep 17 00:00:00 2001 From: justcool393 Date: Wed, 12 Oct 2022 09:01:43 -0700 Subject: [PATCH] partially revert this for main --- files/__main__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index e07c75ea7..8a6f0261a 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -85,8 +85,8 @@ def before_request(): with open('/site_settings.json', 'r', encoding='utf_8') as f: app.config['SETTINGS'] = json.load(f) - if request.host != app.config["SERVER_NAME"]: abort(403, "Unauthorized host provided.") - if request.headers.get("CF-Worker"): abort(403, "Cloudflare workers are not allowed to access this website.") + if request.host != app.config["SERVER_NAME"]: return {"error": "Unauthorized host provided."}, 403 + if request.headers.get("CF-Worker"): return {"error": "Cloudflare workers are not allowed to access this website."}, 403 if not app.config['SETTINGS']['Bots'] and request.headers.get("Authorization"): abort(403)