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", "")
|
||||
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"]
|
||||
|
||||
Reference in New Issue
Block a user