]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Strict actor url comparison
authorChocobozzz <me@florianbigard.com>
Thu, 3 Dec 2020 15:12:58 +0000 (16:12 +0100)
committerChocobozzz <me@florianbigard.com>
Thu, 3 Dec 2020 15:12:58 +0000 (16:12 +0100)
server/lib/activitypub/actor.ts
server/tests/api/live/live-permanent.ts

index 63975021c920fc53cf02db83cde4dbce2cb0308b..fb5558ff6b7bbc605f891f7fea4db9c8bb7754bc 100644 (file)
@@ -403,7 +403,7 @@ function saveActorAndServerAndModelIfNotExist (
     // Try to fix non HTTPS accounts of remote instances that fixed their URL afterwards
     if (created !== true && actorCreated.url !== actor.url) {
       // Only fix http://example.com/account/djidane to https://example.com/account/djidane
-      if (actorCreated.url.replace('http://', '') !== actor.url.replace('https://', '')) {
+      if (actorCreated.url.replace(/^http:\/\//, '') !== actor.url.replace(/^https:\/\//, '')) {
         throw new Error(`Actor from DB with URL ${actorCreated.url} does not correspond to actor ${actor.url}`)
       }
 
index a64588ed74c1b239791baf3a3d804484bf3ce949..54e4010e9a50792e6f1a32ec37a0d41b237da816 100644 (file)
@@ -4,7 +4,6 @@ import 'mocha'
 import * as chai from 'chai'
 import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models'
 import {
-  checkLiveCleanup,
   cleanupTests,
   createLive,
   doubleFollow,