compare with adminFqdn instead of adminLocation
This commit is contained in:
@@ -127,7 +127,6 @@ function validateHostname(location, domain, hostname) {
|
||||
assert.strictEqual(typeof domain, 'string');
|
||||
|
||||
const RESERVED_LOCATIONS = [
|
||||
config.adminLocation(), // FIXME: this shouldn't be here
|
||||
constants.API_LOCATION,
|
||||
constants.SMTP_LOCATION,
|
||||
constants.IMAP_LOCATION,
|
||||
@@ -135,6 +134,8 @@ function validateHostname(location, domain, hostname) {
|
||||
];
|
||||
if (RESERVED_LOCATIONS.indexOf(location) !== -1) return new AppsError(AppsError.BAD_FIELD, location + ' is reserved');
|
||||
|
||||
if (hostname === config.adminFqdn()) return new AppsError(AppsError.BAD_FIELD, location + ' is reserved');
|
||||
|
||||
// workaround https://github.com/oncletom/tld.js/issues/73
|
||||
var tmp = hostname.replace('_', '-');
|
||||
if (!tld.isValid(tmp)) return new AppsError(AppsError.BAD_FIELD, 'Hostname is not a valid domain name');
|
||||
|
||||
Reference in New Issue
Block a user