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