aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-08-31 09:12:10 -0400
committerB. Stack <bgstack15@gmail.com>2023-08-31 09:12:10 -0400
commit33c8ec1bca7597f280f90bfc0bf6586bd9df004f (patch)
tree2d50218b32700328518255b73ac0a002025a753f
parentand now remove url_for from newspipe.lib.utils (diff)
downloadnewspipe-33c8ec1bca7597f280f90bfc0bf6586bd9df004f.tar.gz
newspipe-33c8ec1bca7597f280f90bfc0bf6586bd9df004f.tar.bz2
newspipe-33c8ec1bca7597f280f90bfc0bf6586bd9df004f.zip
use local var instead of application.config
-rw-r--r--newspipe/bootstrap.py6
1 files 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)
bgstack15