]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/requests.ts
Remove old federation compatibility
[github/Chocobozzz/PeerTube.git] / server / helpers / requests.ts
index e09e230863d25f6eef7da65803916a1a86f9a2c6..99127095210638a9390502311626dab425325f1a 100644 (file)
@@ -26,7 +26,6 @@ type PeerTubeRequestOptions = {
     key: string
     headers: string[]
   }
-  timeout?: number
   jsonResponse?: boolean
 } & Pick<GotOptions, 'headers' | 'json' | 'method' | 'searchParams'>
 
@@ -97,10 +96,6 @@ const peertubeGot = got.extend({
             path
           }, httpSignatureOptions)
         }
-      },
-
-      (options: GotOptions) => {
-        options.timeout = REQUEST_TIMEOUT
       }
     ]
   }
@@ -191,7 +186,8 @@ export {
   doRequest,
   doJSONRequest,
   doRequestAndSaveToFile,
-  downloadImage
+  downloadImage,
+  peertubeGot
 }
 
 // ---------------------------------------------------------------------------
@@ -214,9 +210,9 @@ function buildGotOptions (options: PeerTubeRequestOptions) {
   return {
     method: options.method,
     dnsCache: true,
+    timeout: REQUEST_TIMEOUT,
     json: options.json,
     searchParams: options.searchParams,
-    timeout: options.timeout ?? REQUEST_TIMEOUT,
     headers,
     context
   }