X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fwww_listing.t;h=c4511cd1fed11cc46233e24b371b9d5c0f47b7f3;hb=03c9119ec613fa43dcf0a50b5f35754f13228bc8;hp=0aededd43ebc669b211ebbd366ec8bec770e85d8;hpb=846161e3d1207d59f62b3a6718221d6f5ba2b94f;p=public-inbox.git diff --git a/t/www_listing.t b/t/www_listing.t index 0aededd4..c4511cd1 100644 --- a/t/www_listing.t +++ b/t/www_listing.t @@ -35,13 +35,19 @@ like(PublicInbox::WwwListing::fingerprint($bare), qr/\A[a-f0-9]{40}\z/, sub tiny_test { my ($json, $host, $port) = @_; + my $tmp; my $http = HTTP::Tiny->new; my $res = $http->get("http://$host:$port/"); is($res->{status}, 200, 'got HTML listing'); like($res->{content}, qr!!si, 'listing looks like HTML'); + + $res = $http->get("http://$host:$port/", {'Accept-Encoding'=>'gzip'}); + is($res->{status}, 200, 'got gzipped HTML listing'); + IO::Uncompress::Gunzip::gunzip(\(delete $res->{content}) => \$tmp); + like($tmp, qr!!si, 'unzipped listing looks like HTML'); + $res = $http->get("http://$host:$port/manifest.js.gz"); is($res->{status}, 200, 'got manifest'); - my $tmp; IO::Uncompress::Gunzip::gunzip(\(delete $res->{content}) => \$tmp); unlike($tmp, qr/"modified":\s*"/, 'modified is an integer'); my $manifest = $json->decode($tmp);