v1.1.28: HttpClient.get() resilient to empty body — return {} instead of JSONDecodeError

This commit is contained in:
2026-07-29 13:32:17 +04:00
parent edb2d0d526
commit 5af8c5218f
2 changed files with 3 additions and 1 deletions
+2
View File
@@ -86,6 +86,8 @@ class HttpClient:
kwargs.setdefault("timeout", 10)
r = self._session.get(f"{self._endpoint}{path}", **kwargs)
r.raise_for_status()
if not r.text or not r.text.strip():
return {} # пустой ответ (напр. validate-cfs успех)
return r.json()
def post(self, path, data=None, **kwargs):
+1 -1
View File
@@ -18,7 +18,7 @@ from routes.api import bp as api_bp
from routes.api_test import bp as api_test_bp
# Версия — меняется при КАЖДОМ изменении кода. Показывается в топбаре UI.
VERSION = "1.1.27"
VERSION = "1.1.28"
app = Flask(__name__, template_folder="templates", static_folder="static")
app.config["NUBES_API_ENDPOINT"] = os.getenv("NUBES_API_ENDPOINT", "https://lk-api-gateway-test.ngcloud.ru/api/v1/svc")