From ef781ae0b1d761587b78f6db9abbca93024161e6 Mon Sep 17 00:00:00 2001 From: kqjy Date: Sat, 22 Nov 2025 23:03:50 +0800 Subject: [PATCH] Fix hardcoded localhost fallback --- app/ui.py | 3 ++- app/version.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/app/ui.py b/app/ui.py index adf1f6f..120c52f 100644 --- a/app/ui.py +++ b/app/ui.py @@ -224,7 +224,8 @@ def logout(): @ui_bp.get("/docs") def docs_page(): principal = _current_principal() - api_base = current_app.config.get("API_BASE_URL") or "http://127.0.0.1:5000" + # Use the current request's host as the default API base if not configured + api_base = current_app.config.get("API_BASE_URL") or request.host_url api_base = api_base.rstrip("/") parsed = urlparse(api_base) api_host = parsed.netloc or parsed.path or api_base diff --git a/app/version.py b/app/version.py index bda6952..950456f 100644 --- a/app/version.py +++ b/app/version.py @@ -1,7 +1,7 @@ """Central location for the application version string.""" from __future__ import annotations -APP_VERSION = "0.1.1" +APP_VERSION = "0.1.2" def get_version() -> str: