]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/helpers/custom-validators/activitypub/misc.ts
Feature/filter already watched videos (#5739)
[github/Chocobozzz/PeerTube.git] / server / helpers / custom-validators / activitypub / misc.ts
index ff15f115f8d81145049083f7179f9b295ab3f243..279ad83dc694d96c4e5b33eca5ca6269742e96b7 100644 (file)
@@ -1,6 +1,6 @@
 import validator from 'validator'
+import { CONFIG } from '@server/initializers/config'
 import { CONSTRAINTS_FIELDS } from '../../../initializers/constants'
-import { isTestOrDevInstance } from '../../core-utils'
 import { exists } from '../misc'
 
 function isUrlValid (url: string) {
@@ -13,7 +13,7 @@ function isUrlValid (url: string) {
   }
 
   // We validate 'localhost', so we don't have the top level domain
-  if (isTestOrDevInstance()) {
+  if (CONFIG.WEBSERVER.HOSTNAME === 'localhost' || CONFIG.WEBSERVER.HOSTNAME === '127.0.0.1') {
     isURLOptions.require_tld = false
   }