]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - shared/extra-utils/requests/requests.ts
Fix infohash with object storage
[github/Chocobozzz/PeerTube.git] / shared / extra-utils / requests / requests.ts
index 60a08b13c74c30bebc36d0bf93ea2932b907c706..5bbf7f3bf57124caf93c8278e646ef5f0da491da 100644 (file)
@@ -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 })
 }