From 20607bd628f4f8ea985661a8ce123ea482058144 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 5 Jul 2020 23:27:40 +0000 Subject: www: start making gzipfilter the parent response class Virtually all of our responses are going to be gzipped, anyways. This will allow us to utilize zlib as a buffering layer and share common code for async blob retrieval responses. To streamline this and allow GzipFilter to be a parent class, we'll replace the NoopFilter with a similar CompressNoop class which emulates the two Compress::Raw::Zlib::Deflate methods we use. This drops a bunch of redundant code and will hopefully make upcoming WwwStream changes easier to reason about. --- lib/PublicInbox/WwwStatic.pm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib/PublicInbox/WwwStatic.pm') diff --git a/lib/PublicInbox/WwwStatic.pm b/lib/PublicInbox/WwwStatic.pm index d0611949..051d2e03 100644 --- a/lib/PublicInbox/WwwStatic.pm +++ b/lib/PublicInbox/WwwStatic.pm @@ -17,7 +17,6 @@ use HTTP::Date qw(time2str); use HTTP::Status qw(status_message); use Errno qw(EACCES ENOTDIR ENOENT); use URI::Escape qw(uri_escape_utf8); -use PublicInbox::NoopFilter; use PublicInbox::GzipFilter qw(gzf_maybe); use PublicInbox::Hval qw(ascii_html); use Plack::MIME; @@ -313,7 +312,7 @@ sub dir_response ($$$) { my $path_info_html = ascii_html($path_info); my $h = [qw(Content-Type text/html Content-Length), undef]; - my $gzf = gzf_maybe($h, $env) || PublicInbox::NoopFilter::new(); + my $gzf = gzf_maybe($h, $env); $gzf->zmore("Index of $path_info_html" . ${$self->{style}} . "
Index of $path_info_html

\n");
-- 
cgit v1.2.3-24-ge0c7