GNOME Bugzilla – Bug 679230
shouldn't refuse cookies for non suffixed domains
Last modified: 2012-07-17 12:34:20 UTC
The recent addition of TLD support (5a304922), and the refusal to accept cookies for well known public domains (587464fd) broke access to some intranet applications, as they were called as http://server/ (note the absence of TLD), and this is now treated as a well known public domain. Valid TLD are listed in effective_tld_names.dat, so it's hopefully possible to handle the situation. $ grep ^com$ ../data/effective_tld_names.dat com $ grep ^server$ ../data/effective_tld_names.dat $
Created attachment 217837 [details] [review] Patch Fixed use case and added a couple of test cases.
Comment on attachment 217837 [details] [review] Patch >+ /* Unlisted TLD.*/ >+ { "example", NULL }, >+ /* Do not check these 3 because we do not want to force every URL to have a public suffix. */ > /* { "example.example", NULL }, */ > /* { "b.example.example", NULL }, */ > /* { "a.b.example.example", NULL }, */ Why shouldn't those be uncommented as well? If, as the comment says, we don't want to force every URL to have a public suffix, then doesn't that mean we should return NULL for those domains? Looking at soup_tld_get_base_domain_internal(): /* We hit the top domain, use it if it's listed as valid. */ if (!next_dot) { tld = cur_domain; break; } but the code doesn't do what the comment says; if the domain was listed, we would have dealt with it above. Shouldn't this return an error and NULL? (Making that change makes the commented-out tests pass as well.)
I committed the patch with my suggested change, to get this in for the release today. Reopen if this turns out to be wrong...
Reopening, because soup_tld_domain_is_public_suffix() still returns TRUE for non suffixed domains. I think we need to handle SOUP_TLD_ERROR_NO_BASE_DOMAIN error and return FALSE in that case.
Created attachment 219004 [details] [review] Handle SOUP_TLD_ERROR_NO_BASE_DOMAIN in soup_tld_domain_is_public_suffix()
Pushed.