fix: URL полигона — стенд перед /api/v1/svc, а не после (v1.2.31)

Было:  https://polygon.../api/v1/svc/test/instances → 404
Стало: https://polygon.../test/api/v1/svc/instances → OK

Замена /api/v1/svc → /{stand}/api/v1/svc.
This commit is contained in:
2026-08-03 08:56:29 +04:00
parent 0a62eb3c58
commit 9a801e6bff
2 changed files with 5 additions and 4 deletions
+4 -3
View File
@@ -71,9 +71,10 @@ def get_client():
polygon = current_app.config.get("POLYGON_ENDPOINT", "")
stand = get_polygon_stand()
# POLYGON_ENDPOINT = "https://polygon.../api/v1/svc"
# → "https://polygon.../{stand}/api/v1/svc"
# rstrip на случай trailing slash в конфиге
return HttpClient(f"{polygon.rstrip('/')}/{stand}", token)
# Стенд ВСТАВЛЯЕТСЯ перед /api/v1/svc:
# "https://polygon.../api/v1/svc" → "https://polygon.../test/api/v1/svc"
# Простая замена "/api/v1/svc" → "/{stand}/api/v1/svc"
return HttpClient(polygon.replace("/api/v1/svc", f"/{stand}/api/v1/svc"), token)
# Облако: NUBES_API_ENDPOINT с автоопределением
endpoint = current_app.config["NUBES_API_ENDPOINT"]
+1 -1
View File
@@ -32,7 +32,7 @@ from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp
# Версия — показывается в топбаре UI. Меняется при КАЖДОМ изменении кода.
# Нужна для фильтрации истории (пользователь видит только записи своей версии).
VERSION = "1.2.30"
VERSION = "1.2.31"
# Flask-приложение с Jinja2-шаблонами из папки templates/
app = Flask(__name__, template_folder="templates", static_folder="static")