Subject: | amazonaws.com hosts fail to yield proper domain |
Date: | Tue, 14 Oct 2014 16:54:53 -0400 |
To: | bug-Domain-PublicSuffix [...] rt.cpan.org |
From: | "J.D. Baldwin" <baldwin [...] panix.com> |
Hi. I am running your package Domain::PublicSuffix on a Linux host
with Perl 5.20.0:
$ uname -a
Linux hostname 2.6.18-194.11.3.el5 #1 SMP Mon Aug 23 15:51:38 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
amrndhl219 : ~/ti/projects/20141014_track_domains $ perl -v
This is perl 5, version 20, subversion 0 (v5.20.0) built for x86_64-linux-thread-multi-ld
...
I have a version of effective_tld_names.dat I downloaded today. It
contains some special lines for amazonaws.com hosts. In part:
// Amazon S3 : https://aws.amazon.com/s3/
// Submitted by Courtney Eckhardt <coec@amazon.com> 2013-03-22
s3.amazonaws.com
s3-us-west-2.amazonaws.com
s3-us-west-1.amazonaws.com
s3-eu-west-1.amazonaws.com
s3-ap-southeast-1.amazonaws.com
s3-ap-southeast-2.amazonaws.com
s3-ap-northeast-1.amazonaws.com
s3-sa-east-1.amazonaws.com
s3-us-gov-west-1.amazonaws.com
s3-fips-us-gov-west-1.amazonaws.com
s3-website-us-east-1.amazonaws.com
s3-website-us-west-2.amazonaws.com
s3-website-us-west-1.amazonaws.com
s3-website-eu-west-1.amazonaws.com
s3-website-ap-southeast-1.amazonaws.com
s3-website-ap-southeast-2.amazonaws.com
s3-website-ap-northeast-1.amazonaws.com
s3-website-sa-east-1.amazonaws.com
s3-website-us-gov-west-1.amazonaws.com
I wrote a test program to try to get the root domain of
s3.amazonaws.com, which should have returned amazonaws.com, but
instead throws an error:
$ cat test.pl
#!/opt/gnu/bin/perl5.20.0
use strict;
use warnings;
use Domain::PublicSuffix;
my $root_dom = Domain::PublicSuffix->new( { 'data_file' => 'effective_tld_names.dat',
'domain_allow_underscore' => 1 } )
or die "Cannot create Domain::PublicSuffix object: $!";
print $root_dom->get_root_domain( 's3.amazonaws.com' ), "\n";
print "ERROR: " . $root_dom->error(), "\n";
$ ./test.pl
ERROR: Domain not valid
Although I am mystified as to why s3.amazonaws.com should be
considered a "domain," apparently that is the intent of the
effective_tld_names.dat file. But it shouldn't be an error to submit
it. Seems like a bug to me. I'd appreciate your taking a look at it.
Thanks.
jd