1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 19:42:24 +02:00

Fix tests

This commit is contained in:
Chocobozzz 2024-08-14 16:14:06 +02:00
parent fa1d5c76f8
commit 38cc3910ff
No known key found for this signature in database
GPG key ID: 583A612D890159BE
4 changed files with 13 additions and 10 deletions

View file

@ -124,10 +124,14 @@ export const peertubeGot = CONFIG.FEDERATION.PREVENT_SSRF
// ---------------------------------------------------------------------------
export function doRequest (url: string, options: PeerTubeRequestOptions = {}) {
export function doRequest (url: string, options: PeerTubeRequestOptions & { preventSSRF?: false } = {}) {
const gotOptions = buildGotOptions(options) as OptionsOfTextResponseBody
return peertubeGot(url, gotOptions)
const gotInstance = options.preventSSRF === false
? unsafeSSRFGot
: peertubeGot
return gotInstance(url, gotOptions)
.catch(err => { throw buildRequestError(err) })
}