aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/activitypub
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-03 16:12:58 +0100
committerChocobozzz <me@florianbigard.com>2020-12-03 16:12:58 +0100
commite26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c (patch)
treecdf51710673b15b13e398981548cf0e36fc72895 /server/lib/activitypub
parent5147a6d945dcac2f15e85acd7db88d41d8bdc768 (diff)
downloadPeerTube-e26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c.tar.gz
PeerTube-e26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c.tar.zst
PeerTube-e26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c.zip
Strict actor url comparison
Diffstat (limited to 'server/lib/activitypub')
-rw-r--r--server/lib/activitypub/actor.ts2
1 files changed, 1 insertions, 1 deletions
diff --git a/server/lib/activitypub/actor.ts b/server/lib/activitypub/actor.ts
index 63975021c..fb5558ff6 100644
--- a/server/lib/activitypub/actor.ts
+++ b/server/lib/activitypub/actor.ts
@@ -403,7 +403,7 @@ function saveActorAndServerAndModelIfNotExist (
403 // Try to fix non HTTPS accounts of remote instances that fixed their URL afterwards 403 // Try to fix non HTTPS accounts of remote instances that fixed their URL afterwards
404 if (created !== true && actorCreated.url !== actor.url) { 404 if (created !== true && actorCreated.url !== actor.url) {
405 // Only fix http://example.com/account/djidane to https://example.com/account/djidane 405 // Only fix http://example.com/account/djidane to https://example.com/account/djidane
406 if (actorCreated.url.replace('http://', '') !== actor.url.replace('https://', '')) { 406 if (actorCreated.url.replace(/^http:\/\//, '') !== actor.url.replace(/^https:\/\//, '')) {
407 throw new Error(`Actor from DB with URL ${actorCreated.url} does not correspond to actor ${actor.url}`) 407 throw new Error(`Actor from DB with URL ${actorCreated.url} does not correspond to actor ${actor.url}`)
408 } 408 }
409 409