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:
+4
-3
@@ -71,9 +71,10 @@ def get_client():
|
|||||||
polygon = current_app.config.get("POLYGON_ENDPOINT", "")
|
polygon = current_app.config.get("POLYGON_ENDPOINT", "")
|
||||||
stand = get_polygon_stand()
|
stand = get_polygon_stand()
|
||||||
# POLYGON_ENDPOINT = "https://polygon.../api/v1/svc"
|
# POLYGON_ENDPOINT = "https://polygon.../api/v1/svc"
|
||||||
# → "https://polygon.../{stand}/api/v1/svc"
|
# Стенд ВСТАВЛЯЕТСЯ перед /api/v1/svc:
|
||||||
# rstrip на случай trailing slash в конфиге
|
# "https://polygon.../api/v1/svc" → "https://polygon.../test/api/v1/svc"
|
||||||
return HttpClient(f"{polygon.rstrip('/')}/{stand}", token)
|
# Простая замена "/api/v1/svc" → "/{stand}/api/v1/svc"
|
||||||
|
return HttpClient(polygon.replace("/api/v1/svc", f"/{stand}/api/v1/svc"), token)
|
||||||
|
|
||||||
# Облако: NUBES_API_ENDPOINT с автоопределением
|
# Облако: NUBES_API_ENDPOINT с автоопределением
|
||||||
endpoint = current_app.config["NUBES_API_ENDPOINT"]
|
endpoint = current_app.config["NUBES_API_ENDPOINT"]
|
||||||
|
|||||||
+1
-1
@@ -32,7 +32,7 @@ from routes.api_scenario_defs import bp_defs as api_scenario_defs_bp
|
|||||||
|
|
||||||
# Версия — показывается в топбаре UI. Меняется при КАЖДОМ изменении кода.
|
# Версия — показывается в топбаре UI. Меняется при КАЖДОМ изменении кода.
|
||||||
# Нужна для фильтрации истории (пользователь видит только записи своей версии).
|
# Нужна для фильтрации истории (пользователь видит только записи своей версии).
|
||||||
VERSION = "1.2.30"
|
VERSION = "1.2.31"
|
||||||
|
|
||||||
# Flask-приложение с Jinja2-шаблонами из папки templates/
|
# Flask-приложение с Jinja2-шаблонами из папки templates/
|
||||||
app = Flask(__name__, template_folder="templates", static_folder="static")
|
app = Flask(__name__, template_folder="templates", static_folder="static")
|
||||||
|
|||||||
Reference in New Issue
Block a user