X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Frequests.ts;h=99127095210638a9390502311626dab425325f1a;hb=bacb544dbb548955d3f47365902b104d787a51a3;hp=e09e230863d25f6eef7da65803916a1a86f9a2c6;hpb=8729a87024fc837f7dd6f13afeec90cf6dda1c06;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/requests.ts b/server/helpers/requests.ts index e09e23086..991270952 100644 --- a/server/helpers/requests.ts +++ b/server/helpers/requests.ts @@ -26,7 +26,6 @@ type PeerTubeRequestOptions = { key: string headers: string[] } - timeout?: number jsonResponse?: boolean } & Pick @@ -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 }