Strict actor url comparison

pull/3397/head
Chocobozzz 2020-12-03 16:12:58 +01:00
parent 5147a6d945
commit e26dc0cdbd
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 1 additions and 2 deletions

View File

@ -403,7 +403,7 @@ function saveActorAndServerAndModelIfNotExist (
// Try to fix non HTTPS accounts of remote instances that fixed their URL afterwards // Try to fix non HTTPS accounts of remote instances that fixed their URL afterwards
if (created !== true && actorCreated.url !== actor.url) { if (created !== true && actorCreated.url !== actor.url) {
// Only fix http://example.com/account/djidane to https://example.com/account/djidane // 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}`) throw new Error(`Actor from DB with URL ${actorCreated.url} does not correspond to actor ${actor.url}`)
} }

View File

@ -4,7 +4,6 @@ import 'mocha'
import * as chai from 'chai' import * as chai from 'chai'
import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models' import { LiveVideoCreate, VideoDetails, VideoPrivacy, VideoState } from '@shared/models'
import { import {
checkLiveCleanup,
cleanupTests, cleanupTests,
createLive, createLive,
doubleFollow, doubleFollow,