dns: fqdn only needs domain string

This is from the caas days, when we had hyphenated subdomains flag
This commit is contained in:
Girish Ramakrishnan
2022-11-28 21:23:06 +01:00
parent cab7409d85
commit b70572a6e9
23 changed files with 75 additions and 87 deletions
+6 -6
View File
@@ -59,22 +59,22 @@ function api(provider) {
}
}
function fqdn(subdomain, domainObject) {
function fqdn(subdomain, domain) {
assert.strictEqual(typeof subdomain, 'string');
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof domain, 'string');
return subdomain + (subdomain ? '.' : '') + domainObject.domain;
return subdomain + (subdomain ? '.' : '') + domain;
}
// Hostname validation comes from RFC 1123 (section 2.1)
// Domain name validation comes from RFC 2181 (Name syntax)
// https://en.wikipedia.org/wiki/Hostname#Restrictions_on_valid_host_names
// We are validating the validity of the location-fqdn as host name (and not dns name)
function validateHostname(subdomain, domainObject) {
function validateHostname(subdomain, domain) {
assert.strictEqual(typeof subdomain, 'string');
assert.strictEqual(typeof domainObject, 'object');
assert.strictEqual(typeof domain, 'string');
const hostname = fqdn(subdomain, domainObject);
const hostname = fqdn(subdomain, domain);
const RESERVED_SUBDOMAINS = [
constants.SMTP_SUBDOMAIN,