diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-09 09:36:31 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-01-09 09:36:31 +0100 |
commit | e0b56b7495e809581a1e6447794bf7573a78af56 (patch) | |
tree | 7bf3917b7109fc8d671c994b4f501fd020257b38 /shared/extra-utils/requests/check-api-params.ts | |
parent | 240458d0c95133bfb03a3f695a1b4e5cb63e20ef (diff) | |
download | PeerTube-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.ts | 12 |
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 | ||
14 | function checkBadCountPagination (url: string, path: string, token?: string, query = {}) { | 14 | async 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 | ||
24 | function checkBadSortPagination (url: string, path: string, token?: string, query = {}) { | 32 | function checkBadSortPagination (url: string, path: string, token?: string, query = {}) { |