aboutsummaryrefslogtreecommitdiffhomepage
path: root/shared/extra-utils/requests
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-09-09 09:31:50 +0200
committerChocobozzz <me@florianbigard.com>2021-09-09 09:35:30 +0200
commit790c2837ddcb443c0f1ea6adcdcb101dfe159d01 (patch)
tree2f1c957363e1c00475a7ab7c75c09efe61fba004 /shared/extra-utils/requests
parentb4c945f3c727d1ce5de5a4af69d6dfa14c83468e (diff)
downloadPeerTube-790c2837ddcb443c0f1ea6adcdcb101dfe159d01.tar.gz
PeerTube-790c2837ddcb443c0f1ea6adcdcb101dfe159d01.tar.zst
PeerTube-790c2837ddcb443c0f1ea6adcdcb101dfe159d01.zip
Fix silent 500 after resumable upload
Diffstat (limited to 'shared/extra-utils/requests')
-rw-r--r--shared/extra-utils/requests/requests.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts
index 5bbf7f3bf..501e0b374 100644
--- a/shared/extra-utils/requests/requests.ts
+++ b/shared/extra-utils/requests/requests.ts
@@ -57,9 +57,15 @@ function makeActivityPubGetRequest (url: string, path: string, expectedStatus =
57 }) 57 })
58} 58}
59 59
60function makeDeleteRequest (options: CommonRequestParams) { 60function makeDeleteRequest (options: CommonRequestParams & {
61 query?: any
62 rawQuery?: string
63}) {
61 const req = request(options.url).delete(options.path) 64 const req = request(options.url).delete(options.path)
62 65
66 if (options.query) req.query(options.query)
67 if (options.rawQuery) req.query(options.rawQuery)
68
63 return buildRequest(req, { accept: 'application/json', expectedStatus: HttpStatusCode.BAD_REQUEST_400, ...options }) 69 return buildRequest(req, { accept: 'application/json', expectedStatus: HttpStatusCode.BAD_REQUEST_400, ...options })
64} 70}
65 71