remotes/1693045480750635534/spooky-22
Aevann1 2022-04-05 18:29:27 +02:00
parent f2ac1847e3
commit ee7b9b59c5
1 changed files with 4 additions and 0 deletions

View File

@ -88,6 +88,10 @@ mail = Mail(app)
@app.before_request
def before_request():
host = request.headers.get("Host", "")
if host.strip().lower() != app.config["SERVER_NAME"].strip().lower(): return {"error":f"Unauthorized host provided ({host})."}, 401
if request.headers.get("CF-Worker", "") != "": return {"error":"Cloudflare workers are not allowed to access this website."}, 401
if request.method.lower() != "get" and app.config["READ_ONLY"]:
return {"error":f"{app.config['SITE_NAME']} is currently in read-only mode."}, 500