diff options
author | Eric Wong <e@yhbt.net> | 2020-03-21 02:03:44 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-03-25 01:48:34 +0000 |
commit | a71cb67a1237c450a9cbbd6738c5af3b73ba4c61 (patch) | |
tree | 514fd2f9f289622615069850828475c09fc8ecc4 /t/httpd-corner.psgi | |
parent | decbb9936a25dfedf6ecd916d8e0403f06217ec9 (diff) | |
download | public-inbox-a71cb67a1237c450a9cbbd6738c5af3b73ba4c61.tar.gz |
We'll be supporting gzipped from sqlite3(1) dumps for altid files in future commits. In the future (and if we survive), we may replace Plack::Middleware::Deflater with our own GzipFilter to work better with asynchronous responses without relying on memory-intensive anonymous subs.
Diffstat (limited to 't/httpd-corner.psgi')
-rw-r--r-- | t/httpd-corner.psgi | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/t/httpd-corner.psgi b/t/httpd-corner.psgi index 35d1216e..f2427234 100644 --- a/t/httpd-corner.psgi +++ b/t/httpd-corner.psgi @@ -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"; |