Support naked domains as external location

Let the user add an A record for naked domains

Fixes #272
This commit is contained in:
Girish Ramakrishnan
2017-04-03 14:51:17 -07:00
parent 3f6e8273a7
commit 14ca0c1623
4 changed files with 36 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
// !!!
// This module is manually patched by us to not only report valid domains, but verify that subdomains are not accepted
// !!!
'use strict';
angular.module('ngTld', [])
.factory('ngTld', ngTld)
@@ -16,9 +17,14 @@ function ngTld() {
return (path.slice(-1) !== '.') && !!tld.getDomain(path) && path !== tld.getDomain(path);
}
function isNakedDomain(path) {
return (path.slice(-1) !== '.') && !!tld.getDomain(path) && path === tld.getDomain(path);
}
return {
tldExists: tldExists,
isSubdomain: isSubdomain
isSubdomain: isSubdomain,
isNakedDomain: isNakedDomain
};
}
@@ -37,4 +43,3 @@ function checkTld(ngTld) {
}
};
}