DaveAKing / guava-libraries

Automatically exported from code.google.com/p/guava-libraries
Apache License 2.0
0 stars 0 forks source link

InternetDomainName needs better documentation to educate users on what public suffixes really are #1565

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
The following test works in 14.0.1 and is broken in 15.0

  @Test
  public void testGuava() {
    Assert.assertEquals("blogspot.com",
        InternetDomainName.from("erikb.blogspot.com").topPrivateDomain().name());
  }

Original issue reported on code.google.com by benjamin...@gmail.com on 31 Oct 2013 at 9:46

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 31 Oct 2013 at 9:55

GoogleCodeExporter commented 9 years ago
This looks intentional to me. The Mozilla TLD list had blogspot.com added about 
a year ago, so foo.blogspot.com should be considered the top private domain 
under "public domain" blogspot.com:

http://mxr.mozilla.org/mozilla-central/source/netwerk/dns/effective_tld_names.da
t?raw=1

Original comment by cpov...@google.com on 31 Oct 2013 at 10:09

GoogleCodeExporter commented 9 years ago
huh. i'm not sure how it's a "top-level" domain if you can have a TLD under a 
TLD

Original comment by benjamin...@gmail.com on 31 Oct 2013 at 10:45

GoogleCodeExporter commented 9 years ago
Yeah. That's probably one of the reasons that they've taken to calling it a 
"public suffix list" rather than a "TLD list"[*]. That way, ".com" can be a 
public suffix, and so can "blogspot.com."

[*] http://publicsuffix.org/ (Yeah, the file is still called 
"effective_tld_names"....)

Original comment by cpov...@google.com on 31 Oct 2013 at 10:47

GoogleCodeExporter commented 9 years ago
I think we have a documentation fix or ten to make here.  We give examples like 
that .com is and google.com isn't -- we *really* should give an example like 
blogspot.com too (but pick one that has been a PS for more years).

Original comment by kevinb@google.com on 31 Oct 2013 at 10:49

GoogleCodeExporter commented 9 years ago
i don't suppose we could also add a method to be able to get the TLD? or is TLD 
a deprecated concept that no longer exists?

Original comment by benjamin...@gmail.com on 31 Oct 2013 at 11:03

GoogleCodeExporter commented 9 years ago
I think that it's still a real concept. Possibly we could dig up and provide an 
authoritative list if there's demand. What would you be using the TLD for?

Original comment by cpov...@google.com on 31 Oct 2013 at 11:11

GoogleCodeExporter commented 9 years ago
We were parsing the domains out of URLs in order to aggregate how many URLs we 
had for a given domain. I.e. how many blogspot.com, linkedin.com, github.com, 
etc. in a generic way.

Original comment by benjamin...@gmail.com on 31 Oct 2013 at 11:15

GoogleCodeExporter commented 9 years ago
What I want is the Second-level domain 
(http://en.wikipedia.org/wiki/Second-level_domain). Chrome must have a list 
since it requires extension developers to specify Second-level domains: 
http://developer.chrome.com/extensions/messaging.html

Original comment by benjamin...@gmail.com on 21 Nov 2013 at 8:16

GoogleCodeExporter commented 9 years ago
I think that Chrome is using the same data:

https://code.google.com/p/chromium/codesearch#chromium/src/net/base/registry_con
trolled_domains/effective_tld_names.dat

http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/manifes
t_handlers/externally_connectable.cc?revision=235462#l126
or
https://code.google.com/p/chromium/codesearch#chromium/src/chrome/common/extensi
ons/manifest_handlers/externally_connectable.cc

Original comment by cpov...@google.com on 21 Nov 2013 at 3:06

GoogleCodeExporter commented 9 years ago
Hmm, should we just include some of 
https://code.google.com/p/guava-libraries/wiki/InternetDomainNameExplained in 
InternetDomainName's javadoc?

Original comment by cgdecker@google.com on 18 Jul 2014 at 4:16

GoogleCodeExporter commented 9 years ago
This issue has been migrated to GitHub.

It can be found at https://github.com/google/guava/issues/<issue id>

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:12

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 1 Nov 2014 at 4:17

GoogleCodeExporter commented 9 years ago

Original comment by cgdecker@google.com on 3 Nov 2014 at 9:08