- my $res;
- $res = $cb->(GET('/test/_/text/help/'));
- like($res->content, qr!<title>public-inbox help.*</title>!,
- 'default help');
- $res = $cb->(GET('/test/_/text/config/raw'));
+ my $gunzipped;
+ my $req = GET('/test/_/text/help/');
+ my $res = $cb->($req);
+ my $content = $res->content;
+ like($content, qr!<title>public-inbox help.*</title>!, 'default help');
+ $req->header('Accept-Encoding' => 'gzip');
+ $res = $cb->($req);
+ is($res->header('Content-Encoding'), 'gzip', 'got gzip encoding');
+ is($res->header('Content-Type'), 'text/html; charset=UTF-8',
+ 'got gzipped HTML');
+ IO::Uncompress::Gunzip::gunzip(\($res->content) => \$gunzipped);
+ is($gunzipped, $content, 'gzipped content is correct');
+
+ $req = GET('/test/_/text/config/raw');
+ $res = $cb->($req);
+ $content = $res->content;
+ my $olen = $res->header('Content-Length');