From e4c8bde7ba35185eea40a959fd245a2c66373167 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 5 Apr 2022 18:49:05 +0200 Subject: [PATCH] fsfd --- files/__main__.py | 5 ++--- files/templates/authforms.html | 4 ++-- files/templates/chat.html | 2 +- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- 11 files changed, 17 insertions(+), 18 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 7dd659491..9f4231d30 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -88,9 +88,8 @@ 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.host != app.config["SERVER_NAME"]: return {"error":"Unauthorized host provided."}, 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 diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 3730837cd..e2878e3c0 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/chat.html b/files/templates/chat.html index ab581ccd8..c90da0930 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -14,7 +14,7 @@ Chat - + {% if v.css %} diff --git a/files/templates/default.html b/files/templates/default.html index 901f2c255..7847f5b99 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 7352cf315..653b7f033 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 4d4cdd854..d4e3a78ac 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 4c8b28eb3..c31951585 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings2.html b/files/templates/settings2.html index f34dc9ac3..0f8f7a066 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -39,10 +39,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index d2bf71b80..9ad21be41 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 1cc2eb0e7..14fb995e1 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 31f6a37c4..7f882ddf9 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}