aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-10-11 13:42:58 +0200
committerChocobozzz <me@florianbigard.com>2022-10-11 13:42:58 +0200
commite5fc6b598325c861a7696e320b8de0eecb856cc7 (patch)
treed663ee3acee5605828dae924ac0592d1646d0801 /server/helpers/custom-validators
parentcea2fd90ddb3bf57c2fed77128938d12d4c2be6b (diff)
downloadPeerTube-e5fc6b598325c861a7696e320b8de0eecb856cc7.tar.gz
PeerTube-e5fc6b598325c861a7696e320b8de0eecb856cc7.tar.zst
PeerTube-e5fc6b598325c861a7696e320b8de0eecb856cc7.zip
Fix host validation on locahost
Diffstat (limited to 'server/helpers/custom-validators')
-rw-r--r--server/helpers/custom-validators/servers.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/helpers/custom-validators/servers.ts b/server/helpers/custom-validators/servers.ts
index b9f45c282..94fda05aa 100644
--- a/server/helpers/custom-validators/servers.ts
+++ b/server/helpers/custom-validators/servers.ts
@@ -1,6 +1,6 @@
1import validator from 'validator' 1import validator from 'validator'
2import { CONFIG } from '@server/initializers/config'
2import { CONSTRAINTS_FIELDS } from '../../initializers/constants' 3import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
3import { isTestOrDevInstance } from '../core-utils'
4import { exists, isArray } from './misc' 4import { exists, isArray } from './misc'
5 5
6function isHostValid (host: string) { 6function isHostValid (host: string) {
@@ -10,7 +10,7 @@ function isHostValid (host: string) {
10 } 10 }
11 11
12 // We validate 'localhost', so we don't have the top level domain 12 // We validate 'localhost', so we don't have the top level domain
13 if (isTestOrDevInstance()) { 13 if (CONFIG.WEBSERVER.HOSTNAME === 'localhost') {
14 isURLOptions.require_tld = false 14 isURLOptions.require_tld = false
15 } 15 }
16 16