aboutsummaryrefslogtreecommitdiffhomepage
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
parent5147a6d945dcac2f15e85acd7db88d41d8bdc768 (diff)
downloadPeerTube-e26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c.tar.gz
PeerTube-e26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c.tar.zst
PeerTube-e26dc0cdbda13f8b65ab2be3a0e13e7ef5c4b98c.zip
Strict actor url comparison
-rw-r--r--server/lib/activitypub/actor.ts2
-rw-r--r--server/tests/api/live/live-permanent.ts1
2 files changed, 1 insertions, 2 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
diff --git a/server/tests/api/live/live-permanent.ts b/server/tests/api/live/live-permanent.ts
index a64588ed7..54e4010e9 100644
--- a/server/tests/api/live/live-permanent.ts
+++ b/server/tests/api/live/live-permanent.ts
@@ -4,7 +4,6 @@ import 'mocha'
4import * as chai from 'chai' 4import * as chai from 'chai'
5import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models' 5import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models'
6import { 6import {
7 checkLiveCleanup,
8 cleanupTests, 7 cleanupTests,
9 createLive, 8 createLive,
10 doubleFollow, 9 doubleFollow,