fix: AUR RPC API 404 — use list params for arg[] encoding
This commit is contained in:
+20
-10
@@ -34,11 +34,16 @@ class AURSource:
|
||||
async def aur_info(name: str) -> AURPackage | None:
|
||||
"""Fetch package info from AUR RPC API."""
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
resp = await client.get(AUR_RPC, params={
|
||||
"type": "info",
|
||||
"v": "5",
|
||||
"arg[]": name,
|
||||
})
|
||||
resp = await client.get(
|
||||
AUR_RPC,
|
||||
params=[
|
||||
("type", "info"),
|
||||
("v", "5"),
|
||||
("arg[]", name),
|
||||
],
|
||||
)
|
||||
if resp.status_code == 404:
|
||||
return None
|
||||
resp.raise_for_status()
|
||||
data: dict[str, Any] = resp.json()
|
||||
|
||||
@@ -94,11 +99,16 @@ async def aur_sources(name: str) -> AURSource | None:
|
||||
async def _raw_info(name: str) -> dict[str, Any] | None:
|
||||
"""Get raw RPC result for a package."""
|
||||
async with httpx.AsyncClient(timeout=30) as client:
|
||||
resp = await client.get(AUR_RPC, params={
|
||||
"type": "info",
|
||||
"v": "5",
|
||||
"arg[]": name,
|
||||
})
|
||||
resp = await client.get(
|
||||
AUR_RPC,
|
||||
params=[
|
||||
("type", "info"),
|
||||
("v", "5"),
|
||||
("arg[]", name),
|
||||
],
|
||||
)
|
||||
if resp.status_code == 404:
|
||||
return None
|
||||
resp.raise_for_status()
|
||||
data = resp.json()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user