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

Don't guess remote tracker URL

This commit is contained in:
Chocobozzz 2021-02-18 10:15:11 +01:00 committed by Chocobozzz
parent 2451916e45
commit d9a2a03196
21 changed files with 458 additions and 94 deletions

View file

@ -201,10 +201,12 @@ function checkUrlsSameHost (url1: string, url2: string) {
return idHost && actorHost && idHost.toLowerCase() === actorHost.toLowerCase()
}
function buildRemoteVideoBaseUrl (video: MVideoWithHost, path: string) {
function buildRemoteVideoBaseUrl (video: MVideoWithHost, path: string, scheme?: string) {
if (!scheme) scheme = REMOTE_SCHEME.HTTP
const host = video.VideoChannel.Actor.Server.host
return REMOTE_SCHEME.HTTP + '://' + host + path
return scheme + '://' + host + path
}
// ---------------------------------------------------------------------------