Browse Source

Fix tld check when there is no match

pull/77/head
brantje 2 years ago
parent
commit
38bfecd081
No account linked to committer's email address
1 changed files with 8 additions and 1 deletions
  1. 8
    1
      js/lib/parseUrl.js

+ 8
- 1
js/lib/parseUrl.js View File

@@ -51,7 +51,14 @@ function processURL(URL, ignoreProtocol, ignoreSubdomain, ignorePath, ignorePort
}
else {
var result = host.match(/[^./]+\.[^./]+$/); // catch the two last parts, it's de hostname and the tld
baseHost = result[0];
//@TODO Implement known list of TLDs
//@url https://github.com/131/node-tld/blob/master/effective_tld_names.json

if(result) {
baseHost = result[0];
} else {
baseHost = host;
}
}
var returnURL = "";
if (!ignoreProtocol) {

Loading…
Cancel
Save