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)