Fix host validation on locahost

pull/5325/head
Chocobozzz 2022-10-11 13:42:58 +02:00
parent cea2fd90dd
commit e5fc6b5983
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
1 changed files with 2 additions and 2 deletions

View File

@ -1,6 +1,6 @@
import validator from 'validator' import validator from 'validator'
import { CONFIG } from '@server/initializers/config'
import { CONSTRAINTS_FIELDS } from '../../initializers/constants' import { CONSTRAINTS_FIELDS } from '../../initializers/constants'
import { isTestOrDevInstance } from '../core-utils'
import { exists, isArray } from './misc' import { exists, isArray } from './misc'
function isHostValid (host: string) { function isHostValid (host: string) {
@ -10,7 +10,7 @@ function isHostValid (host: string) {
} }
// We validate 'localhost', so we don't have the top level domain // We validate 'localhost', so we don't have the top level domain
if (isTestOrDevInstance()) { if (CONFIG.WEBSERVER.HOSTNAME === 'localhost') {
isURLOptions.require_tld = false isURLOptions.require_tld = false
} }