Skip to content

Commit 6daf817

Browse files
committed
fix: keeper client handles chunked responses (resp.length=None)
1 parent 707a621 commit 6daf817

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

13.7 KB
Binary file not shown.

agent_bridge.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,8 @@ def _req(self, method: str, path: str, body: dict = None) -> dict:
355355
req = urllib.request.Request(url, data=data, headers=headers, method=method)
356356
try:
357357
resp = urllib.request.urlopen(req)
358-
return json.loads(resp.read()) if resp.length else {}
358+
data = resp.read()
359+
return json.loads(data) if data else {}
359360
except Exception as e:
360361
return {"error": str(e)}
361362

0 commit comments

Comments
 (0)