aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/activitypub.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/activitypub.ts')
-rw-r--r--server/helpers/activitypub.ts6
1 files changed, 3 insertions, 3 deletions
diff --git a/server/helpers/activitypub.ts b/server/helpers/activitypub.ts
index 9f9e8fba7..22f8550ca 100644
--- a/server/helpers/activitypub.ts
+++ b/server/helpers/activitypub.ts
@@ -5,7 +5,7 @@ import { Activity } from '../../shared/models/activitypub'
5import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants' 5import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants'
6import { signJsonLDObject } from './peertube-crypto' 6import { signJsonLDObject } from './peertube-crypto'
7import { pageToStartAndCount } from './core-utils' 7import { pageToStartAndCount } from './core-utils'
8import { parse } from 'url' 8import { URL } from 'url'
9import { MActor, MVideoAccountLight } from '../typings/models' 9import { MActor, MVideoAccountLight } from '../typings/models'
10 10
11function activityPubContextify <T> (data: T) { 11function activityPubContextify <T> (data: T) {
@@ -161,8 +161,8 @@ function getAPId (activity: string | { id: string }) {
161} 161}
162 162
163function checkUrlsSameHost (url1: string, url2: string) { 163function checkUrlsSameHost (url1: string, url2: string) {
164 const idHost = parse(url1).host 164 const idHost = new URL(url1).host
165 const actorHost = parse(url2).host 165 const actorHost = new URL(url2).host
166 166
167 return idHost && actorHost && idHost.toLowerCase() === actorHost.toLowerCase() 167 return idHost && actorHost && idHost.toLowerCase() === actorHost.toLowerCase()
168} 168}