]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-corner.psgi
qspawn: reinstate filter support, add gzip filter
[public-inbox.git] / t / httpd-corner.psgi
index 35d1216ec761e92134647ae50dec3a8bd8565f2a..f2427234c05afa8803868c25168af0c01a0d7a90 100644 (file)
@@ -85,6 +85,15 @@ my $app = sub {
                        close $null;
                        [ 200, [ qw(Content-Type application/octet-stream) ]];
                });
+       } elsif ($path eq '/psgi-return-gzip') {
+               require PublicInbox::Qspawn;
+               require PublicInbox::GzipFilter;
+               my $cmd = [qw(echo hello world)];
+               my $qsp = PublicInbox::Qspawn->new($cmd);
+               $env->{'qspawn.filter'} = PublicInbox::GzipFilter->new;
+               return $qsp->psgi_return($env, undef, sub {
+                       [ 200, [ qw(Content-Type application/octet-stream)]]
+               });
        } elsif ($path eq '/pid') {
                $code = 200;
                push @$body, "$$\n";