fix: enforce VIP content boundary and PATCH updates
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user