mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
fix(fastapi): sanitize PP/O parameters for package search
This definitely leaked through in more areas. We'll need to reuse this new utility function in a few other routes in upcoming commits. Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
8dcdc7ff38
commit
7f4c011dc3
3 changed files with 24 additions and 11 deletions
|
@ -486,15 +486,11 @@ def test_pkgbase(client: TestClient, package: Package):
|
|||
|
||||
|
||||
def test_packages(client: TestClient, packages: List[Package]):
|
||||
""" Test the / packages route with defaults.
|
||||
|
||||
Defaults:
|
||||
50 results per page
|
||||
offset of 0
|
||||
"""
|
||||
with client as request:
|
||||
response = request.get("/packages", params={
|
||||
"SeB": "X" # "X" isn't valid, defaults to "nd"
|
||||
"SeB": "X", # "X" isn't valid, defaults to "nd"
|
||||
"PP": "1 or 1",
|
||||
"O": "0 or 0"
|
||||
})
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue