From 33c8ec1bca7597f280f90bfc0bf6586bd9df004f Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Thu, 31 Aug 2023 09:12:10 -0400 Subject: use local var instead of application.config --- newspipe/bootstrap.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/newspipe/bootstrap.py b/newspipe/bootstrap.py index 1af61d2f..640f2e5f 100644 --- a/newspipe/bootstrap.py +++ b/newspipe/bootstrap.py @@ -72,8 +72,10 @@ else: set_logging(application.config["LOG_PATH"]) +prefix = "" if "PREFIX" in application.config: application.wsgi_app = ReverseProxied(application.wsgi_app, script_name=application.config["PREFIX"]) + prefix = application.config["PREFIX"] db = SQLAlchemy(application) @@ -119,7 +121,7 @@ def utility_processor(): """ Custom reverse-proxy support for url_for """ print(f"DEBUG: generating url_for {endpoint}") _uf = f_url_for(endpoint, **values) - if application.config and "PREFIX" in application.config: - _uf = str(application.config("PREFIX")) + _uf + if prefix: + _uf = str(prefix) + _uf return _uf return dict(url_for=url_for) -- cgit