summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhackademix2018-08-18 03:27:35 +0200
committerGitHub2018-08-18 03:27:35 +0200
commit8c8b959474beec64fcb7bfb31c2a17d237180891 (patch)
tree45c5bd6dc28c5acd8936010c8b6cb463eaa82a65 /src
parent2f9c5299afe0d612deff7f89c948bb44332f2abf (diff)
parent49e34cd176241d8f5caad1035159564a06715d74 (diff)
downloadnoscript-8c8b959474beec64fcb7bfb31c2a17d237180891.tar.gz
noscript-8c8b959474beec64fcb7bfb31c2a17d237180891.tar.xz
noscript-8c8b959474beec64fcb7bfb31c2a17d237180891.zip
Merge pull request #13 from Lekensteyn/empty-tld-fixes
Fix policy configuration for domains without dots
Diffstat (limited to 'src')
-rw-r--r--src/lib/tld.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/tld.js b/src/lib/tld.js
index 78dc029..8789477 100644
--- a/src/lib/tld.js
+++ b/src/lib/tld.js
@@ -12,9 +12,11 @@ var tld = {
pos = domain.search(this._tldRx);
if (pos === -1) {
// TLD not in the public suffix list, fall back to the "one-dot rule"
+ // (for a.b.c.tld, assume the domain to be "c.tld")
pos = domain.lastIndexOf(".");
if (pos === -1) {
- return "";
+ // No dots at all? Likely a private domain in a LAN.
+ return domain;
}
}
pos = domain.lastIndexOf(".", pos - 1) + 1;