diff options
author | Chocobozzz <me@florianbigard.com> | 2022-10-11 13:42:58 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-10-11 13:42:58 +0200 |
commit | e5fc6b598325c861a7696e320b8de0eecb856cc7 (patch) | |
tree | d663ee3acee5605828dae924ac0592d1646d0801 /server/helpers/custom-validators/servers.ts | |
parent | cea2fd90ddb3bf57c2fed77128938d12d4c2be6b (diff) | |
download | PeerTube-e5fc6b598325c861a7696e320b8de0eecb856cc7.tar.gz PeerTube-e5fc6b598325c861a7696e320b8de0eecb856cc7.tar.zst PeerTube-e5fc6b598325c861a7696e320b8de0eecb856cc7.zip |
Fix host validation on locahost
Diffstat (limited to 'server/helpers/custom-validators/servers.ts')
-rw-r--r-- | server/helpers/custom-validators/servers.ts | 4 |
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 @@ | |||
1 | import validator from 'validator' | 1 | import validator from 'validator' |
2 | import { CONFIG } from '@server/initializers/config' | ||
2 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' | 3 | import { CONSTRAINTS_FIELDS } from '../../initializers/constants' |
3 | import { isTestOrDevInstance } from '../core-utils' | ||
4 | import { exists, isArray } from './misc' | 4 | import { exists, isArray } from './misc' |
5 | 5 | ||
6 | function isHostValid (host: string) { | 6 | function 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 | ||