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:
Kevin Morris 2022-01-13 21:32:13 -08:00
parent 60ae676075
commit 43b7fdb61d
No known key found for this signature in database
GPG key ID: F7E46DED420788F3
3 changed files with 43 additions and 2 deletions

View file

@ -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)