v1.1.28: HttpClient.get() resilient to empty body — return {} instead of JSONDecodeError
This commit is contained in:
@@ -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
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user