aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/activitypub.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-02-18 10:15:11 +0100
committerChocobozzz <chocobozzz@cpy.re>2021-02-18 13:38:09 +0100
commitd9a2a03196275065c28f4a0b7d4d7bc9992d77a1 (patch)
tree14579db95cd07506bf3d8e5c0af3ef1630e8700c /server/helpers/activitypub.ts
parent2451916e45420fedf556913ce121f3964c4b57d6 (diff)
downloadPeerTube-d9a2a03196275065c28f4a0b7d4d7bc9992d77a1.tar.gz
PeerTube-d9a2a03196275065c28f4a0b7d4d7bc9992d77a1.tar.zst
PeerTube-d9a2a03196275065c28f4a0b7d4d7bc9992d77a1.zip
Don't guess remote tracker URL
Diffstat (limited to 'server/helpers/activitypub.ts')
-rw-r--r--server/helpers/activitypub.ts6
1 files changed, 4 insertions, 2 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index 02a9d4026..08aef2908 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -201,10 +201,12 @@ function checkUrlsSameHost (url1: string, url2: string) {
201 return idHost && actorHost && idHost.toLowerCase() === actorHost.toLowerCase() 201 return idHost && actorHost && idHost.toLowerCase() === actorHost.toLowerCase()
202} 202}
203 203
204function buildRemoteVideoBaseUrl (video: MVideoWithHost, path: string) { 204function buildRemoteVideoBaseUrl (video: MVideoWithHost, path: string, scheme?: string) {
205 if (!scheme) scheme = REMOTE_SCHEME.HTTP
206
205 const host = video.VideoChannel.Actor.Server.host 207 const host = video.VideoChannel.Actor.Server.host
206 208
207 return REMOTE_SCHEME.HTTP + '://' + host + path 209 return scheme + '://' + host + path
208} 210}
209 211
210// --------------------------------------------------------------------------- 212// ---------------------------------------------------------------------------