isValidHostname is gone

This commit is contained in:
Girish Ramakrishnan
2025-03-17 15:50:33 +01:00
parent b3131169ad
commit dca9266697

View File

@@ -733,7 +733,8 @@ function validateServerAddress(serverAddress) {
// workaround https://github.com/oncletom/tld.js/issues/73
const tmp = serverAddress.replace('_', '-');
if (!tld.isValidHostname(tmp)) return new BoxError(BoxError.BAD_FIELD, 'serverAddress is not a valid hostname');
if (!tld.isValid(tmp)) return new BoxError(BoxError.BAD_FIELD, 'Hostname is not a valid domain name');
if (tmp.length > 253) return new BoxError(BoxError.BAD_FIELD, 'Hostname length exceeds 253 characters');
return null;
}