aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests/check-api-params.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-09 09:36:31 +0100
committerChocobozzz <me@florianbigard.com>2020-01-09 09:36:31 +0100
commite0b56b7495e809581a1e6447794bf7573a78af56 (patch)
tree7bf3917b7109fc8d671c994b4f501fd020257b38 /shared/extra-utils/requests/check-api-params.ts
parent240458d0c95133bfb03a3f695a1b4e5cb63e20ef (diff)
downloadPeerTube-e0b56b7495e809581a1e6447794bf7573a78af56.tar.gz
PeerTube-e0b56b7495e809581a1e6447794bf7573a78af56.tar.zst
PeerTube-e0b56b7495e809581a1e6447794bf7573a78af56.zip
Return an error on invalid count pagination
Diffstat (limited to 'shared/extra-utils/requests/check-api-params.ts')
-rw-r--r--shared/extra-utils/requests/check-api-params.ts12
1 files changed, 10 insertions, 2 deletions
diff --git a/shared/extra-utils/requests/check-api-params.ts b/shared/extra-utils/requests/check-api-params.ts
index a2a549682..c34c7c216 100644
--- a/shared/extra-utils/requests/check-api-params.ts
+++ b/shared/extra-utils/requests/check-api-params.ts
@@ -11,14 +11,22 @@ function checkBadStartPagination (url: string, path: string, token?: string, que
11 }) 11 })
12} 12}
13 13
14function checkBadCountPagination (url: string, path: string, token?: string, query = {}) { 14async function checkBadCountPagination (url: string, path: string, token?: string, query = {}) {
15 return makeGetRequest({ 15 await makeGetRequest({
16 url, 16 url,
17 path, 17 path,
18 token, 18 token,
19 query: immutableAssign(query, { count: 'hello' }), 19 query: immutableAssign(query, { count: 'hello' }),
20 statusCodeExpected: 400 20 statusCodeExpected: 400
21 }) 21 })
22
23 await makeGetRequest({
24 url,
25 path,
26 token,
27 query: immutableAssign(query, { count: 2000 }),
28 statusCodeExpected: 400
29 })
22} 30}
23 31
24function checkBadSortPagination (url: string, path: string, token?: string, query = {}) { 32function checkBadSortPagination (url: string, path: string, token?: string, query = {}) {