about summary refs log tree commit homepage
path: root/t/httpd-corner.t
diff options
context:
space:
mode:
Diffstat (limited to 't/httpd-corner.t')
-rw-r--r--t/httpd-corner.t25
1 files changed, 25 insertions, 0 deletions
diff --git a/t/httpd-corner.t b/t/httpd-corner.t
index c99e5ec7..e50aa436 100644
--- a/t/httpd-corner.t
+++ b/t/httpd-corner.t
@@ -22,6 +22,7 @@ my $err = "$tmpdir/stderr.log";
 my $out = "$tmpdir/stdout.log";
 my $psgi = "./t/httpd-corner.psgi";
 my $sock = tcp_server() or die;
+my @zmods = qw(PublicInbox::GzipFilter IO::Uncompress::Gunzip);
 
 # make sure stdin is not a pipe for lsof test to check for leaking pipes
 open(STDIN, '<', '/dev/null') or die 'no /dev/null: $!';
@@ -324,6 +325,14 @@ SKIP: {
         close $fh or die "curl errored out \$?=$?";
         is($n, 30 * 1024 * 1024, 'got expected output from curl');
         is($non_zero, 0, 'read all zeros');
+
+        require_mods(@zmods, 1);
+        open $fh, '-|', qw(curl -sS), "$base/psgi-return-gzip" or die;
+        binmode $fh;
+        my $buf = do { local $/; <$fh> };
+        close $fh or die "curl errored out \$?=$?";
+        IO::Uncompress::Gunzip::gunzip(\$buf => \(my $out));
+        is($out, "hello world\n");
 }
 
 {
@@ -596,6 +605,22 @@ SKIP: {
         is_deeply([], [keys %child], 'no extra pipes with -W0');
 };
 
+# ensure compatibility with other PSGI servers
+SKIP: {
+        require_mods(@zmods, qw(Plack::Test HTTP::Request::Common), 3);
+        use_ok 'HTTP::Request::Common';
+        use_ok 'Plack::Test';
+        my $app = require $psgi;
+        test_psgi($app, sub {
+                my ($cb) = @_;
+                my $req = GET('http://example.com/psgi-return-gzip');
+                my $res = $cb->($req);
+                my $buf = $res->content;
+                IO::Uncompress::Gunzip::gunzip(\$buf => \(my $out));
+                is($out, "hello world\n");
+        });
+}
+
 done_testing();
 
 sub capture {