Move to eslint
[oweals/peertube.git] / server / initializers / checker-after-init.ts
index 44efd346ccb9187efd4dceb82b676a167f023adc..97802312933e804a0894a7b903ed2bfe2bba03b4 100644 (file)
@@ -3,7 +3,7 @@ import { isProdInstance, isTestInstance } from '../helpers/core-utils'
 import { UserModel } from '../models/account/user'
 import { ApplicationModel } from '../models/application/application'
 import { OAuthClientModel } from '../models/oauth/oauth-client'
-import { parse } from 'url'
+import { URL } from 'url'
 import { CONFIG } from './config'
 import { logger } from '../helpers/logger'
 import { getServerActor } from '../helpers/utils'
@@ -16,7 +16,7 @@ import { WEBSERVER } from './constants'
 async function checkActivityPubUrls () {
   const actor = await getServerActor()
 
-  const parsed = parse(actor.url)
+  const parsed = new URL(actor.url)
   if (WEBSERVER.HOST !== parsed.host) {
     const NODE_ENV = config.util.getEnv('NODE_ENV')
     const NODE_CONFIG_DIR = config.util.getEnv('NODE_CONFIG_DIR')