aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/activitypub.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-31 16:56:52 +0100
committerChocobozzz <me@florianbigard.com>2020-02-03 08:31:02 +0100
commita15871560f80e07386c1dabb8370cd2664ecfd1f (patch)
tree44440e140c9e43b0d7f97ade777a76e649e0553d /server/helpers/activitypub.ts
parenta22046d166805222ca76060e471b6cb3d419a32d (diff)
downloadPeerTube-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.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}