X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=shared%2Fextra-utils%2Frequests%2Frequests.ts;h=5bbf7f3bf57124caf93c8278e646ef5f0da491da;hb=fb72d2e1c24cd4660fd6611ef723c5827c47294c;hp=60a08b13c74c30bebc36d0bf93ea2932b907c706;hpb=6f9719b568fad75959a1404b6927b7a278061c41;p=github%2FChocobozzz%2FPeerTube.git diff --git a/shared/extra-utils/requests/requests.ts b/shared/extra-utils/requests/requests.ts index 60a08b13c..5bbf7f3bf 100644 --- a/shared/extra-utils/requests/requests.ts +++ b/shared/extra-utils/requests/requests.ts @@ -29,9 +29,12 @@ function makeRawRequest (url: string, expectedStatus?: HttpStatusCode, range?: s function makeGetRequest (options: CommonRequestParams & { query?: any + rawQuery?: string }) { const req = request(options.url).get(options.path) - .query(options.query) + + if (options.query) req.query(options.query) + if (options.rawQuery) req.query(options.rawQuery) return buildRequest(req, { contentType: 'application/json', expectedStatus: HttpStatusCode.BAD_REQUEST_400, ...options }) }