From e5fc6b598325c861a7696e320b8de0eecb856cc7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 Oct 2022 13:42:58 +0200 Subject: Fix host validation on locahost --- server/helpers/custom-validators/servers.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'server') 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 @@ import validator from 'validator' +import { CONFIG } from '@server/initializers/config' import { CONSTRAINTS_FIELDS } from '../../initializers/constants' -import { isTestOrDevInstance } from '../core-utils' import { exists, isArray } from './misc' function isHostValid (host: string) { @@ -10,7 +10,7 @@ function isHostValid (host: string) { } // We validate 'localhost', so we don't have the top level domain - if (isTestOrDevInstance()) { + if (CONFIG.WEBSERVER.HOSTNAME === 'localhost') { isURLOptions.require_tld = false } -- cgit v1.2.3