mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(rpc): display rpc doc when no query string is provided
Closes #255 Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
60ae676075
commit
43b7fdb61d
3 changed files with 43 additions and 2 deletions
|
@ -12,7 +12,7 @@ from fastapi.responses import JSONResponse
|
|||
|
||||
from aurweb import defaults
|
||||
from aurweb.ratelimit import check_ratelimit
|
||||
from aurweb.rpc import RPC
|
||||
from aurweb.rpc import RPC, documentation
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
|
@ -74,6 +74,9 @@ async def rpc(request: Request,
|
|||
args: Optional[List[str]] = Query(default=[], alias="arg[]"),
|
||||
callback: Optional[str] = Query(default=None)):
|
||||
|
||||
if not request.url.query:
|
||||
return documentation()
|
||||
|
||||
# Create a handle to our RPC class.
|
||||
rpc = RPC(version=v, type=type)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue