fix: enforce VIP content boundary and PATCH updates

This commit is contained in:
AHMED
2026-10-09 16:27:49 +03:00
parent 61aea8d83e
commit 87e653cc96
9 changed files with 103 additions and 8 deletions
+2 -2
View File
@@ -126,7 +126,7 @@ class AgentApi:
except HTTPError as error:
return error.code, error.read(), error.headers.get("content-type", "")
except (TimeoutError, URLError) as error:
if method in ("POST", "PUT"):
if method in ("POST", "PATCH"):
raise AmbiguousWrite(f"agent API {method} outcome is unknown") from error
raise
@@ -176,7 +176,7 @@ class AgentApi:
probe = self._probe(body)
if probe:
self.body_probes[slug] = probe
status, raw, _ = self._request("PUT", f"/api/agent/posts/{quote(slug)}", body)
status, raw, _ = self._request("PATCH", f"/api/agent/posts/{quote(slug)}", body)
if status != 200:
raise RuntimeError(f"agent API update failed ({status})")
return self._decode(status, raw)