Handle Seerr CSRF on request creation
Magent CI/CD / verify (push) Canceled after 2m30s
Magent CI/CD / deploy-prod (push) Canceled after 0s
Magent CI/CD / deploy-beta (push) Canceled after 0s

This commit is contained in:
2026-08-31 15:11:57 +12:00
parent a55369190b
commit 547ed754e6
3 changed files with 91 additions and 2 deletions
+20 -1
View File
@@ -62,6 +62,24 @@ class ApiClient:
return f"{payload[:500]}..."
return payload
async def _send_request(
self,
client: httpx.AsyncClient,
method: str,
url: str,
*,
headers: Dict[str, str],
params: Optional[Dict[str, Any]],
payload: Optional[Dict[str, Any]],
) -> httpx.Response:
return await client.request(
method,
url,
headers=headers,
params=params,
json=payload,
)
async def _request(
self,
method: str,
@@ -89,7 +107,8 @@ class ApiClient:
)
try:
async with httpx.AsyncClient(timeout=timeout_seconds) as client:
response = await client.request(
response = await self._send_request(
client,
method,
url,
headers=self.headers(),