]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/activitypub.ts
Move to eslint
[github/Chocobozzz/PeerTube.git] / server / helpers / activitypub.ts
index 9f9e8fba79fe2b31d9e64af34c865e454d6df99b..22f8550caf37a4a343d736e0eada920e82d3c611 100644 (file)
@@ -5,7 +5,7 @@ import { Activity } from '../../shared/models/activitypub'
 import { ACTIVITY_PUB, REMOTE_SCHEME } from '../initializers/constants'
 import { signJsonLDObject } from './peertube-crypto'
 import { pageToStartAndCount } from './core-utils'
-import { parse } from 'url'
+import { URL } from 'url'
 import { MActor, MVideoAccountLight } from '../typings/models'
 
 function activityPubContextify <T> (data: T) {
@@ -161,8 +161,8 @@ function getAPId (activity: string | { id: string }) {
 }
 
 function checkUrlsSameHost (url1: string, url2: string) {
-  const idHost = parse(url1).host
-  const actorHost = parse(url2).host
+  const idHost = new URL(url1).host
+  const actorHost = new URL(url2).host
 
   return idHost && actorHost && idHost.toLowerCase() === actorHost.toLowerCase()
 }