diff options
Diffstat (limited to 'server/helpers/activitypub.ts')
-rw-r--r-- | server/helpers/activitypub.ts | 6 |
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' | |||
5 | import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants' | 5 | import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants' |
6 | import { signJsonLDObject } from './peertube-crypto' | 6 | import { signJsonLDObject } from './peertube-crypto' |
7 | import { pageToStartAndCount } from './core-utils' | 7 | import { pageToStartAndCount } from './core-utils' |
8 | import { parse } from 'url' | 8 | import { URL } from 'url' |
9 | import { MActor, MVideoAccountLight } from '../typings/models' | 9 | import { MActor, MVideoAccountLight } from '../typings/models' |
10 | 10 | ||
11 | function activityPubContextify <T> (data: T) { | 11 | function activityPubContextify <T> (data: T) { |
@@ -161,8 +161,8 @@ function getAPId (activity: string | { id: string }) { | |||
161 | } | 161 | } |
162 | 162 | ||
163 | function checkUrlsSameHost (url1: string, url2: string) { | 163 | function 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 | } |