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"]