diff options
author | Chocobozzz <me@florianbigard.com> | 2020-01-31 16:56:52 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2020-02-03 08:31:02 +0100 |
commit | a15871560f80e07386c1dabb8370cd2664ecfd1f (patch) | |
tree | 44440e140c9e43b0d7f97ade777a76e649e0553d /server/helpers/activitypub.ts | |
parent | a22046d166805222ca76060e471b6cb3d419a32d (diff) | |
download | PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.gz PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.tar.zst PeerTube-a15871560f80e07386c1dabb8370cd2664ecfd1f.zip |
Move to eslintcontain
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 | } |