1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-07 14:19:10 -04:00

die if PageNotFound page is returned successfully

This commit is contained in:
Kenichi Ishigaki 2015-11-24 15:59:48 +09:00
parent 150e9a44e5
commit e657de6c50

View file

@ -238,6 +238,11 @@ sub mirror {
print "Downloading $version from $url...\n"; print "Downloading $version from $url...\n";
my $res = HTTP::Tiny->new->mirror($url => $file); my $res = HTTP::Tiny->new->mirror($url => $file);
die "Can't mirror $file: ".$res->{reason} unless $res->{success}; die "Can't mirror $file: ".$res->{reason} unless $res->{success};
my $content_type = $res->{headers}{'content-type'};
if ($content_type !~ /x\-gzip/) {
unlink $file;
die "Not a gzipped tarball: ".$content_type;
}
} }
my $dir = srcdir($version); my $dir = srcdir($version);
unless ($dir && -d $dir) { unless ($dir && -d $dir) {