From 331b53ca868a89f961cdd01798bac8b86b5d8526 Mon Sep 17 00:00:00 2001 From: Ari Archer Date: Thu, 6 Jun 2024 17:39:25 +0300 Subject: [PATCH] add proxy fix Signed-off-by: Ari Archer --- src/aw/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/aw/__init__.py b/src/aw/__init__.py index a4219d4..9208d50 100644 --- a/src/aw/__init__.py +++ b/src/aw/__init__.py @@ -9,6 +9,7 @@ from base64 import b64encode from typing import Any import flask +from werkzeug.middleware.proxy_fix import ProxyFix from . import util @@ -22,6 +23,7 @@ def create_app(name: str) -> flask.Flask: sys.exit(1) app: flask.Flask = flask.Flask(name) + app.wsgi_app = ProxyFix(app.wsgi_app, x_for=1, x_proto=1) # type: ignore app.config["PREFERRED_URL_SCHEME"] = "http" if app.debug else "https" app.config["DOMAIN"] = "ari.lt"