Also check that the TLD actually exists (#84)

This commit is contained in:
Erayd
2019-04-11 01:46:00 +12:00
committed by GitHub
parent dd4b4ff6d1
commit 9a4a8ca9df
2 changed files with 2 additions and 2 deletions

View File

@@ -67,7 +67,7 @@ function pathToDomain(path) {
continue;
}
var t = TldJS.parse(parts[key]);
if (t.isValid && t.domain !== null) {
if (t.isValid && t.tldExists && t.domain !== null) {
return t.hostname;
}
}

View File

@@ -44,7 +44,7 @@ function pathToDomain(path) {
continue;
}
var t = TldJS.parse(parts[key]);
if (t.isValid && t.domain !== null) {
if (t.isValid && t.tldExists && t.domain !== null) {
return t.hostname;
}
}