go.net/publicsuffix: add an EffectiveTLDPlus1 function.
Also expand the gen.go subset to cover the test cases from
http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt
R=dr.volker.dobler, patrick
CC=golang-dev
https://golang.org/cl/7124044
diff --git a/publicsuffix/gen.go b/publicsuffix/gen.go
index c96d090..71e458d 100644
--- a/publicsuffix/gen.go
+++ b/publicsuffix/gen.go
@@ -143,14 +143,19 @@
if *subset {
switch {
+ case s == "ac.jp" || strings.HasSuffix(s, ".ac.jp"):
+ case s == "ak.us" || strings.HasSuffix(s, ".ak.us"):
case s == "ao" || strings.HasSuffix(s, ".ao"):
case s == "ar" || strings.HasSuffix(s, ".ar"):
case s == "arpa" || strings.HasSuffix(s, ".arpa"):
+ case s == "cy" || strings.HasSuffix(s, ".cy"):
case s == "dyndns.org" || strings.HasSuffix(s, ".dyndns.org"):
case s == "jp":
case s == "kobe.jp" || strings.HasSuffix(s, ".kobe.jp"):
case s == "kyoto.jp" || strings.HasSuffix(s, ".kyoto.jp"):
+ case s == "om" || strings.HasSuffix(s, ".om"):
case s == "uk" || strings.HasSuffix(s, ".uk"):
+ case s == "uk.com" || strings.HasSuffix(s, ".uk.com"):
case s == "tw" || strings.HasSuffix(s, ".tw"):
case s == "zw" || strings.HasSuffix(s, ".zw"):
case s == "xn--p1ai" || strings.HasSuffix(s, ".xn--p1ai"):
diff --git a/publicsuffix/list.go b/publicsuffix/list.go
index 64379ae..baf983e 100644
--- a/publicsuffix/list.go
+++ b/publicsuffix/list.go
@@ -7,8 +7,12 @@
// can directly register names.
package publicsuffix
+// TODO: specify case sensitivity and leading/trailing dot behavior for
+// func PublicSuffix and func EffectiveTLDPlusOne.
+
import (
"exp/cookiejar"
+ "fmt"
"strings"
)
@@ -113,3 +117,17 @@
offset := x & (1<<nodesBitsTextOffset - 1)
return text[offset : offset+length]
}
+
+// EffectiveTLDPlusOne returns the effective top level domain plus one more
+// label. For example, the eTLD+1 for "foo.bar.golang.org" is "golang.org".
+func EffectiveTLDPlusOne(domain string) (string, error) {
+ suffix, _ := PublicSuffix(domain)
+ if len(domain) <= len(suffix) {
+ return "", fmt.Errorf("publicsuffix: cannot derive eTLD+1 for domain %q", domain)
+ }
+ i := len(domain) - len(suffix) - 1
+ if domain[i] != '.' {
+ return "", fmt.Errorf("publicsuffix: invalid public suffix %q for domain %q", suffix, domain)
+ }
+ return domain[1+strings.LastIndex(domain[:i], "."):], nil
+}
diff --git a/publicsuffix/list_test.go b/publicsuffix/list_test.go
index df108ea..c61b998 100644
--- a/publicsuffix/list_test.go
+++ b/publicsuffix/list_test.go
@@ -326,5 +326,79 @@
return len(b[i]) > len(b[j])
}
-// TODO(nigeltao): add the "Effective Top Level Domain Plus 1" tests from
+// eTLDPlusOneTestCases come from
// http://mxr.mozilla.org/mozilla-central/source/netwerk/test/unit/data/test_psl.txt
+var eTLDPlusOneTestCases = []struct {
+ domain, want string
+}{
+ // Empty input.
+ {"", ""},
+ // Unlisted TLD.
+ {"example", ""},
+ {"example.example", "example.example"},
+ {"b.example.example", "example.example"},
+ {"a.b.example.example", "example.example"},
+ // TLD with only 1 rule.
+ {"biz", ""},
+ {"domain.biz", "domain.biz"},
+ {"b.domain.biz", "domain.biz"},
+ {"a.b.domain.biz", "domain.biz"},
+ // TLD with some 2-level rules.
+ {"com", ""},
+ {"example.com", "example.com"},
+ {"b.example.com", "example.com"},
+ {"a.b.example.com", "example.com"},
+ {"uk.com", ""},
+ {"example.uk.com", "example.uk.com"},
+ {"b.example.uk.com", "example.uk.com"},
+ {"a.b.example.uk.com", "example.uk.com"},
+ {"test.ac", "test.ac"},
+ // TLD with only 1 (wildcard) rule.
+ {"cy", ""},
+ {"c.cy", ""},
+ {"b.c.cy", "b.c.cy"},
+ {"a.b.c.cy", "b.c.cy"},
+ // More complex TLD.
+ {"jp", ""},
+ {"test.jp", "test.jp"},
+ {"www.test.jp", "test.jp"},
+ {"ac.jp", ""},
+ {"test.ac.jp", "test.ac.jp"},
+ {"www.test.ac.jp", "test.ac.jp"},
+ {"kyoto.jp", ""},
+ {"test.kyoto.jp", "test.kyoto.jp"},
+ {"ide.kyoto.jp", ""},
+ {"b.ide.kyoto.jp", "b.ide.kyoto.jp"},
+ {"a.b.ide.kyoto.jp", "b.ide.kyoto.jp"},
+ {"c.kobe.jp", ""},
+ {"b.c.kobe.jp", "b.c.kobe.jp"},
+ {"a.b.c.kobe.jp", "b.c.kobe.jp"},
+ {"city.kobe.jp", "city.kobe.jp"},
+ {"www.city.kobe.jp", "city.kobe.jp"},
+ // TLD with a wildcard rule and exceptions.
+ {"om", ""},
+ {"test.om", ""},
+ {"b.test.om", "b.test.om"},
+ {"a.b.test.om", "b.test.om"},
+ {"songfest.om", "songfest.om"},
+ {"www.songfest.om", "songfest.om"},
+ // US K12.
+ {"us", ""},
+ {"test.us", "test.us"},
+ {"www.test.us", "test.us"},
+ {"ak.us", ""},
+ {"test.ak.us", "test.ak.us"},
+ {"www.test.ak.us", "test.ak.us"},
+ {"k12.ak.us", ""},
+ {"test.k12.ak.us", "test.k12.ak.us"},
+ {"www.test.k12.ak.us", "test.k12.ak.us"},
+}
+
+func TestEffectiveTLDPlusOne(t *testing.T) {
+ for _, tc := range eTLDPlusOneTestCases {
+ got, _ := EffectiveTLDPlusOne(tc.domain)
+ if got != tc.want {
+ t.Errorf("%q: got %q, want %q", tc.domain, got, tc.want)
+ }
+ }
+}
diff --git a/publicsuffix/table.go b/publicsuffix/table.go
index 3e50948..5d15ce3 100644
--- a/publicsuffix/table.go
+++ b/publicsuffix/table.go
@@ -23,16 +23,17 @@
)
// numTLD is the number of top level domains.
-const numTLD = 9
+const numTLD = 13
// Text is the combined text of all labels.
-const text = "clubafukuchiyamashinacionakagyorgamecongresodelalengua3govgvhome" +
- "ducityin-addretinagaokakyotambainelip6irischigashiyamaizurujitaw" +
- "arajetjoyoyamazakitajpblogspotkizuridekumiyamakyotangobiernoelec" +
- "tronicomilkyotominamiyamashiromiyazurnantanational-library-scotl" +
- "andyndnsakyotanabebizwmukobenlseikameokamodpromocionetxn--czrw28" +
- "british-libraryawatarparliamentwazukayabe164xn--p1aidvxn--uc0atv" +
- "xn--zf0ao64a"
+const text = "clubacyfukuchiyamashinacionakagyomanpostatecouncilgovgvhomediaph" +
+ "onelin-addretinagaokakyotambainetip6irischigashiyamaizurujitawar" +
+ "akpetroleumiljetjoyomanteljpblogspotk12kizurideduccitykumiyamaky" +
+ "otangobiernoelectronicorgamecongresodelalengua3kyotoyamazakitami" +
+ "namiyamashiromiyazurnantanational-library-scotlandyndnsakyotanab" +
+ "ebizwmukobenlseikameokamodpromocionawrastelecomanmobileusiemenso" +
+ "ngfestxn--czrw28british-libraryawatarparliamentwazukayabe164xn--" +
+ "p1aidvxn--uc0atvxn--zf0ao64a"
// nodes is the list of nodes. Each node is represented as a uint32, which
// encodes the node's children, wildcard bit and node type (as an index into
@@ -51,101 +52,121 @@
// [15 bits] text index
// [ 6 bits] text length
var nodes = [...]uint32{
- 0x01a014c2, // n0x0000 c0x0006 (n0x0009-n0x000f) + I ao
- 0x01e02002, // n0x0001 c0x0007 (n0x000f-n0x0019)* o I ar
- 0x026054c4, // n0x0002 c0x0009 (n0x001a-n0x0020) o I arpa
- 0x02a02502, // n0x0003 c0x000a (n0x0020-n0x0022) + I jp
- 0x03600783, // n0x0004 c0x000d (n0x0042-n0x0043) o I org
- 0x03e05782, // n0x0005 c0x000f (n0x0045-n0x0053) + I tw
- 0x04200182, // n0x0006 c0x0010 (n0x0053-n0x005e)* o I uk
- 0x00205b08, // n0x0007 c0x0000 (---------------) + I xn--p1ai
- 0x01604502, // n0x0008 c0x0005 (---------------)* o I zw
- 0x00200902, // n0x0009 c0x0000 (---------------) + I co
- 0x00200fc2, // n0x000a c0x0000 (---------------) + I ed
- 0x00200e82, // n0x000b c0x0000 (---------------) + I gv
- 0x002010c2, // n0x000c c0x0000 (---------------) + I it
- 0x00202602, // n0x000d c0x0000 (---------------) + I og
- 0x00202542, // n0x000e c0x0000 (---------------) + I pb
- 0x02203143, // n0x000f c0x0008 (n0x0019-n0x001a) o I com
- 0x00600913, // n0x0010 c0x0001 (---------------) ! I congresodelalengua3
- 0x00600fc4, // n0x0011 c0x0001 (---------------) ! I educ
- 0x00602d13, // n0x0012 c0x0001 (---------------) ! I gobiernoelectronico
- 0x00600885, // n0x0013 c0x0001 (---------------) ! I mecon
- 0x006004c6, // n0x0014 c0x0001 (---------------) ! I nacion
- 0x006030c3, // n0x0015 c0x0001 (---------------) ! I nic
- 0x00604ac9, // n0x0016 c0x0001 (---------------) ! I promocion
- 0x00601306, // n0x0017 c0x0001 (---------------) ! I retina
- 0x00600083, // n0x0018 c0x0001 (---------------) ! I uba
- 0x00002588, // n0x0019 c0x0000 (---------------) + blogspot
- 0x00205a04, // n0x001a c0x0000 (---------------) + I e164
- 0x00201187, // n0x001b c0x0000 (---------------) + I in-addr
- 0x002018c3, // n0x001c c0x0000 (---------------) + I ip6
- 0x00201984, // n0x001d c0x0000 (---------------) + I iris
- 0x00202843, // n0x001e c0x0000 (---------------) + I uri
- 0x002038c3, // n0x001f c0x0000 (---------------) + I urn
- 0x02e04604, // n0x0020 c0x000b (n0x0022-n0x0023)* o I kobe
- 0x03203285, // n0x0021 c0x000c (n0x0023-n0x0042) + I kyoto
- 0x00601084, // n0x0022 c0x0001 (---------------) ! I city
- 0x00205905, // n0x0023 c0x0000 (---------------) + I ayabe
- 0x0020014b, // n0x0024 c0x0000 (---------------) + I fukuchiyama
- 0x00201acb, // n0x0025 c0x0000 (---------------) + I higashiyama
- 0x002028c3, // n0x0026 c0x0000 (---------------) + I ide
- 0x002017c3, // n0x0027 c0x0000 (---------------) + I ine
- 0x00202184, // n0x0028 c0x0000 (---------------) + I joyo
- 0x00204847, // n0x0029 c0x0000 (---------------) + I kameoka
- 0x00204984, // n0x002a c0x0000 (---------------) + I kamo
- 0x00202404, // n0x002b c0x0000 (---------------) + I kita
- 0x00202784, // n0x002c c0x0000 (---------------) + I kizu
- 0x00202988, // n0x002d c0x0000 (---------------) + I kumiyama
- 0x002015c8, // n0x002e c0x0000 (---------------) + I kyotamba
- 0x00204249, // n0x002f c0x0000 (---------------) + I kyotanabe
- 0x00202b88, // n0x0030 c0x0000 (---------------) + I kyotango
- 0x00201d07, // n0x0031 c0x0000 (---------------) + I maizuru
- 0x002033c6, // n0x0032 c0x0000 (---------------) + I minami
- 0x002033cf, // n0x0033 c0x0000 (---------------) + I minamiyamashiro
- 0x00203786, // n0x0034 c0x0000 (---------------) + I miyazu
- 0x00204584, // n0x0035 c0x0000 (---------------) + I muko
- 0x0020140a, // n0x0036 c0x0000 (---------------) + I nagaokakyo
- 0x00200607, // n0x0037 c0x0000 (---------------) + I nakagyo
- 0x00203946, // n0x0038 c0x0000 (---------------) + I nantan
- 0x00202249, // n0x0039 c0x0000 (---------------) + I oyamazaki
- 0x002041c5, // n0x003a c0x0000 (---------------) + I sakyo
- 0x00204785, // n0x003b c0x0000 (---------------) + I seika
- 0x00204306, // n0x003c c0x0000 (---------------) + I tanabe
- 0x00201e83, // n0x003d c0x0000 (---------------) + I uji
- 0x00201e89, // n0x003e c0x0000 (---------------) + I ujitawara
- 0x002057c6, // n0x003f c0x0000 (---------------) + I wazuka
- 0x00200309, // n0x0040 c0x0000 (---------------) + I yamashina
- 0x00205386, // n0x0041 c0x0000 (---------------) + I yawata
- 0x03804086, // n0x0042 c0x000e (n0x0043-n0x0045) + dyndns
- 0x00000dc2, // n0x0043 c0x0000 (---------------) + go
- 0x00000f04, // n0x0044 c0x0000 (---------------) + home
- 0x00002588, // n0x0045 c0x0000 (---------------) + blogspot
- 0x00200004, // n0x0046 c0x0000 (---------------) + I club
- 0x00203143, // n0x0047 c0x0000 (---------------) + I com
- 0x00204444, // n0x0048 c0x0000 (---------------) + I ebiz
- 0x00200fc3, // n0x0049 c0x0000 (---------------) + I edu
- 0x00200804, // n0x004a c0x0000 (---------------) + I game
- 0x00200dc3, // n0x004b c0x0000 (---------------) + I gov
- 0x00205cc3, // n0x004c c0x0000 (---------------) + I idv
- 0x002031c3, // n0x004d c0x0000 (---------------) + I mil
- 0x00204cc3, // n0x004e c0x0000 (---------------) + I net
- 0x00200783, // n0x004f c0x0000 (---------------) + I org
- 0x00204d8b, // n0x0050 c0x0000 (---------------) + I xn--czrw28b
- 0x00205d8a, // n0x0051 c0x0000 (---------------) + I xn--uc0atv
- 0x0020600c, // n0x0052 c0x0000 (---------------) + I xn--zf0ao64a
- 0x00602582, // n0x0053 c0x0001 (---------------) ! I bl
- 0x0060500f, // n0x0054 c0x0001 (---------------) ! I british-library
- 0x04600902, // n0x0055 c0x0011 (n0x005e-n0x005f) o I co
- 0x006020c3, // n0x0056 c0x0001 (---------------) ! I jet
- 0x00604a03, // n0x0057 c0x0001 (---------------) ! I mod
- 0x00603a99, // n0x0058 c0x0001 (---------------) ! I national-library-scotland
- 0x00601803, // n0x0059 c0x0001 (---------------) ! I nel
- 0x006030c3, // n0x005a c0x0001 (---------------) ! I nic
- 0x00604703, // n0x005b c0x0001 (---------------) ! I nls
- 0x0060554a, // n0x005c c0x0001 (---------------) ! I parliament
- 0x01601a43, // n0x005d c0x0005 (---------------)* o I sch
- 0x00002588, // n0x005e c0x0000 (---------------) + blogspot
+ 0x01a01442, // n0x0000 c0x0006 (n0x000d-n0x0013) + I ao
+ 0x01e01f82, // n0x0001 c0x0007 (n0x0013-n0x001d)* o I ar
+ 0x026068c4, // n0x0002 c0x0009 (n0x001e-n0x0024) o I arpa
+ 0x02a05b03, // n0x0003 c0x000a (n0x0024-n0x0025) o I com
+ 0x01600142, // n0x0004 c0x0005 (---------------)* o I cy
+ 0x02e02682, // n0x0005 c0x000b (n0x0025-n0x0028) + I jp
+ 0x03a00802, // n0x0006 c0x000e (n0x0048-n0x0052)* o I om
+ 0x03e03583, // n0x0007 c0x000f (n0x0052-n0x0053) o I org
+ 0x04606b82, // n0x0008 c0x0011 (n0x0055-n0x0063) + I tw
+ 0x04a00202, // n0x0009 c0x0012 (n0x0063-n0x006e)* o I uk
+ 0x05205dc2, // n0x000a c0x0014 (n0x006f-n0x0070) o I us
+ 0x00206f08, // n0x000b c0x0000 (---------------) + I xn--p1ai
+ 0x016050c2, // n0x000c c0x0005 (---------------)* o I zw
+ 0x00200ac2, // n0x000d c0x0000 (---------------) + I co
+ 0x00200e82, // n0x000e c0x0000 (---------------) + I ed
+ 0x00200d42, // n0x000f c0x0000 (---------------) + I gv
+ 0x00201e82, // n0x0010 c0x0000 (---------------) + I it
+ 0x00202782, // n0x0011 c0x0000 (---------------) + I og
+ 0x002026c2, // n0x0012 c0x0000 (---------------) + I pb
+ 0x02205b03, // n0x0013 c0x0008 (n0x001d-n0x001e) o I com
+ 0x00603713, // n0x0014 c0x0001 (---------------) ! I congresodelalengua3
+ 0x00602b84, // n0x0015 c0x0001 (---------------) ! I educ
+ 0x00603113, // n0x0016 c0x0001 (---------------) ! I gobiernoelectronico
+ 0x00603685, // n0x0017 c0x0001 (---------------) ! I mecon
+ 0x00600546, // n0x0018 c0x0001 (---------------) ! I nacion
+ 0x006034c3, // n0x0019 c0x0001 (---------------) ! I nic
+ 0x00605689, // n0x001a c0x0001 (---------------) ! I promocion
+ 0x00601286, // n0x001b c0x0001 (---------------) ! I retina
+ 0x00600083, // n0x001c c0x0001 (---------------) ! I uba
+ 0x00002708, // n0x001d c0x0000 (---------------) + blogspot
+ 0x00206e04, // n0x001e c0x0000 (---------------) + I e164
+ 0x00201107, // n0x001f c0x0000 (---------------) + I in-addr
+ 0x00201843, // n0x0020 c0x0000 (---------------) + I ip6
+ 0x00201904, // n0x0021 c0x0000 (---------------) + I iris
+ 0x00202a83, // n0x0022 c0x0000 (---------------) + I uri
+ 0x00204483, // n0x0023 c0x0000 (---------------) + I urn
+ 0x00000202, // n0x0024 c0x0000 (---------------) + uk
+ 0x00200102, // n0x0025 c0x0000 (---------------) + I ac
+ 0x032051c4, // n0x0026 c0x000c (n0x0028-n0x0029)* o I kobe
+ 0x03603bc5, // n0x0027 c0x000d (n0x0029-n0x0048) + I kyoto
+ 0x00602c84, // n0x0028 c0x0001 (---------------) ! I city
+ 0x00206d05, // n0x0029 c0x0000 (---------------) + I ayabe
+ 0x002001cb, // n0x002a c0x0000 (---------------) + I fukuchiyama
+ 0x00201a4b, // n0x002b c0x0000 (---------------) + I higashiyama
+ 0x00202b03, // n0x002c c0x0000 (---------------) + I ide
+ 0x00201743, // n0x002d c0x0000 (---------------) + I ine
+ 0x00202404, // n0x002e c0x0000 (---------------) + I joyo
+ 0x00205407, // n0x002f c0x0000 (---------------) + I kameoka
+ 0x00205544, // n0x0030 c0x0000 (---------------) + I kamo
+ 0x00203e84, // n0x0031 c0x0000 (---------------) + I kita
+ 0x002029c4, // n0x0032 c0x0000 (---------------) + I kizu
+ 0x00202d88, // n0x0033 c0x0000 (---------------) + I kumiyama
+ 0x00201548, // n0x0034 c0x0000 (---------------) + I kyotamba
+ 0x00204e09, // n0x0035 c0x0000 (---------------) + I kyotanabe
+ 0x00202f88, // n0x0036 c0x0000 (---------------) + I kyotango
+ 0x00201c87, // n0x0037 c0x0000 (---------------) + I maizuru
+ 0x00203f86, // n0x0038 c0x0000 (---------------) + I minami
+ 0x00203f8f, // n0x0039 c0x0000 (---------------) + I minamiyamashiro
+ 0x00204346, // n0x003a c0x0000 (---------------) + I miyazu
+ 0x00205144, // n0x003b c0x0000 (---------------) + I muko
+ 0x0020138a, // n0x003c c0x0000 (---------------) + I nagaokakyo
+ 0x00200687, // n0x003d c0x0000 (---------------) + I nakagyo
+ 0x00204506, // n0x003e c0x0000 (---------------) + I nantan
+ 0x00203cc9, // n0x003f c0x0000 (---------------) + I oyamazaki
+ 0x00204d85, // n0x0040 c0x0000 (---------------) + I sakyo
+ 0x00205345, // n0x0041 c0x0000 (---------------) + I seika
+ 0x00204ec6, // n0x0042 c0x0000 (---------------) + I tanabe
+ 0x00201e03, // n0x0043 c0x0000 (---------------) + I uji
+ 0x00201e09, // n0x0044 c0x0000 (---------------) + I ujitawara
+ 0x00206bc6, // n0x0045 c0x0000 (---------------) + I wazuka
+ 0x00200389, // n0x0046 c0x0000 (---------------) + I yamashina
+ 0x00206786, // n0x0047 c0x0000 (---------------) + I yawata
+ 0x00600e4a, // n0x0048 c0x0001 (---------------) ! I mediaphone
+ 0x00605886, // n0x0049 c0x0001 (---------------) ! I nawras
+ 0x0060588d, // n0x004a c0x0001 (---------------) ! I nawrastelecom
+ 0x00605b4a, // n0x004b c0x0001 (---------------) ! I omanmobile
+ 0x00600808, // n0x004c c0x0001 (---------------) ! I omanpost
+ 0x006024c7, // n0x004d c0x0001 (---------------) ! I omantel
+ 0x00601fcc, // n0x004e c0x0001 (---------------) ! I rakpetroleum
+ 0x00605e07, // n0x004f c0x0001 (---------------) ! I siemens
+ 0x00605f88, // n0x0050 c0x0001 (---------------) ! I songfest
+ 0x0060098c, // n0x0051 c0x0001 (---------------) ! I statecouncil
+ 0x04004c46, // n0x0052 c0x0010 (n0x0053-n0x0055) + dyndns
+ 0x00000c82, // n0x0053 c0x0000 (---------------) + go
+ 0x00000dc4, // n0x0054 c0x0000 (---------------) + home
+ 0x00002708, // n0x0055 c0x0000 (---------------) + blogspot
+ 0x00200004, // n0x0056 c0x0000 (---------------) + I club
+ 0x00205b03, // n0x0057 c0x0000 (---------------) + I com
+ 0x00205004, // n0x0058 c0x0000 (---------------) + I ebiz
+ 0x00202b83, // n0x0059 c0x0000 (---------------) + I edu
+ 0x00203604, // n0x005a c0x0000 (---------------) + I game
+ 0x00200c83, // n0x005b c0x0000 (---------------) + I gov
+ 0x002070c3, // n0x005c c0x0000 (---------------) + I idv
+ 0x00202283, // n0x005d c0x0000 (---------------) + I mil
+ 0x00201783, // n0x005e c0x0000 (---------------) + I net
+ 0x00203583, // n0x005f c0x0000 (---------------) + I org
+ 0x0020618b, // n0x0060 c0x0000 (---------------) + I xn--czrw28b
+ 0x0020718a, // n0x0061 c0x0000 (---------------) + I xn--uc0atv
+ 0x0020740c, // n0x0062 c0x0000 (---------------) + I xn--zf0ao64a
+ 0x00602702, // n0x0063 c0x0001 (---------------) ! I bl
+ 0x0060640f, // n0x0064 c0x0001 (---------------) ! I british-library
+ 0x04e00ac2, // n0x0065 c0x0013 (n0x006e-n0x006f) o I co
+ 0x00602343, // n0x0066 c0x0001 (---------------) ! I jet
+ 0x006055c3, // n0x0067 c0x0001 (---------------) ! I mod
+ 0x00604659, // n0x0068 c0x0001 (---------------) ! I national-library-scotland
+ 0x00601043, // n0x0069 c0x0001 (---------------) ! I nel
+ 0x006034c3, // n0x006a c0x0001 (---------------) ! I nic
+ 0x006052c3, // n0x006b c0x0001 (---------------) ! I nls
+ 0x0060694a, // n0x006c c0x0001 (---------------) ! I parliament
+ 0x016019c3, // n0x006d c0x0005 (---------------)* o I sch
+ 0x00002708, // n0x006e c0x0000 (---------------) + blogspot
+ 0x056006c2, // n0x006f c0x0015 (n0x0070-n0x0073) + I ak
+ 0x00202c42, // n0x0070 c0x0000 (---------------) + I cc
+ 0x00202903, // n0x0071 c0x0000 (---------------) + I k12
+ 0x00204883, // n0x0072 c0x0000 (---------------) + I lib
}
// children is the list of nodes' children, the parent's wildcard bit and the
@@ -165,16 +186,20 @@
0x40000000, // c0x0003 (---------------)* +
0x50000000, // c0x0004 (---------------)* !
0x60000000, // c0x0005 (---------------)* o
- 0x0003c009, // c0x0006 (n0x0009-n0x000f) +
- 0x6006400f, // c0x0007 (n0x000f-n0x0019)* o
- 0x20068019, // c0x0008 (n0x0019-n0x001a) o
- 0x2008001a, // c0x0009 (n0x001a-n0x0020) o
- 0x00088020, // c0x000a (n0x0020-n0x0022) +
- 0x6008c022, // c0x000b (n0x0022-n0x0023)* o
- 0x00108023, // c0x000c (n0x0023-n0x0042) +
- 0x2010c042, // c0x000d (n0x0042-n0x0043) o
- 0x00114043, // c0x000e (n0x0043-n0x0045) +
- 0x0014c045, // c0x000f (n0x0045-n0x0053) +
- 0x60178053, // c0x0010 (n0x0053-n0x005e)* o
- 0x2017c05e, // c0x0011 (n0x005e-n0x005f) o
+ 0x0004c00d, // c0x0006 (n0x000d-n0x0013) +
+ 0x60074013, // c0x0007 (n0x0013-n0x001d)* o
+ 0x2007801d, // c0x0008 (n0x001d-n0x001e) o
+ 0x2009001e, // c0x0009 (n0x001e-n0x0024) o
+ 0x20094024, // c0x000a (n0x0024-n0x0025) o
+ 0x000a0025, // c0x000b (n0x0025-n0x0028) +
+ 0x600a4028, // c0x000c (n0x0028-n0x0029)* o
+ 0x00120029, // c0x000d (n0x0029-n0x0048) +
+ 0x60148048, // c0x000e (n0x0048-n0x0052)* o
+ 0x2014c052, // c0x000f (n0x0052-n0x0053) o
+ 0x00154053, // c0x0010 (n0x0053-n0x0055) +
+ 0x0018c055, // c0x0011 (n0x0055-n0x0063) +
+ 0x601b8063, // c0x0012 (n0x0063-n0x006e)* o
+ 0x201bc06e, // c0x0013 (n0x006e-n0x006f) o
+ 0x201c006f, // c0x0014 (n0x006f-n0x0070) o
+ 0x001cc070, // c0x0015 (n0x0070-n0x0073) +
}
diff --git a/publicsuffix/table_test.go b/publicsuffix/table_test.go
index 3b9b3e2..4e0c8f4 100644
--- a/publicsuffix/table_test.go
+++ b/publicsuffix/table_test.go
@@ -26,7 +26,9 @@
"iris.arpa",
"uri.arpa",
"urn.arpa",
+ "*.cy",
"jp",
+ "ac.jp",
"kyoto.jp",
"*.kobe.jp",
"!city.kobe.jp",
@@ -61,6 +63,17 @@
"wazuka.kyoto.jp",
"yamashina.kyoto.jp",
"yawata.kyoto.jp",
+ "*.om",
+ "!mediaphone.om",
+ "!nawrastelecom.om",
+ "!nawras.om",
+ "!omanmobile.om",
+ "!omanpost.om",
+ "!omantel.om",
+ "!rakpetroleum.om",
+ "!siemens.om",
+ "!songfest.om",
+ "!statecouncil.om",
"tw",
"edu.tw",
"gov.tw",
@@ -86,8 +99,13 @@
"!nic.uk",
"!nls.uk",
"!parliament.uk",
+ "ak.us",
+ "k12.ak.us",
+ "cc.ak.us",
+ "lib.ak.us",
"xn--p1ai",
"*.zw",
+ "uk.com",
"blogspot.co.uk",
"blogspot.com.ar",
"blogspot.tw",
@@ -100,10 +118,14 @@
"ao",
"ar",
"arpa",
+ "com",
+ "cy",
"jp",
+ "om",
"org",
"tw",
"uk",
+ "us",
"xn--p1ai",
"zw",
"co",
@@ -129,6 +151,8 @@
"iris",
"uri",
"urn",
+ "uk",
+ "ac",
"kobe",
"kyoto",
"city",
@@ -163,6 +187,16 @@
"wazuka",
"yamashina",
"yawata",
+ "mediaphone",
+ "nawras",
+ "nawrastelecom",
+ "omanmobile",
+ "omanpost",
+ "omantel",
+ "rakpetroleum",
+ "siemens",
+ "songfest",
+ "statecouncil",
"dyndns",
"go",
"home",
@@ -192,4 +226,8 @@
"parliament",
"sch",
"blogspot",
+ "ak",
+ "cc",
+ "k12",
+ "lib",
}