diff --git a/FU.pm b/FU.pm index 4601423..ce830a6 100644 --- a/FU.pm +++ b/FU.pm @@ -739,7 +739,6 @@ sub _error_page($, $code, $title, $msg) { sub _finalize { state $haszlib = eval { require Compress::Raw::Zlib; 1 }; - state $haszstd = eval { require Compress::Zstd; 1 }; my $r = $FU::REQ; if ($r->{status} == 204 || $r->{status} == 304) { @@ -749,17 +748,13 @@ sub _finalize { $r->{resbody} = ''; } else { - if (($haszlib || $haszstd) && length($r->{resbody}) > 256 + if ($haszlib && length($r->{resbody}) > 256 && !defined $r->{reshdr}{'content-encoding'} && FU::compress_mimes->{$r->{reshdr}{'content-type'}}) { $r->{reshdr}{'vary'} = ($r->{reshdr}{'vary'} ? $r->{reshdr}{'vary'}.', ' : '').'accept-encoding' if ($r->{reshdr}{'vary'}||'') !~ /accept-encoding/i; - if ($haszstd && ($r->{hdr}{'accept-encoding'}||'') =~ /zstd/) { - $r->{resbody} = Compress::Zstd::compress($r->{resbody}); - $r->{reshdr}{'content-encoding'} = 'zstd'; - - } elsif ($haszlib && ($r->{hdr}{'accept-encoding'}||'') =~ /gzip/) { + if ($haszlib && ($r->{hdr}{'accept-encoding'}||'') =~ /gzip/) { # Use lower-level API because the higher-level Compress::Zlib loads a whole bunch of other modules. my $z = Compress::Raw::Zlib::Deflate->new(-WindowBits => Compress::Raw::Zlib::WANT_GZIP(), -Level => 3, -AppendOutput => 1); $z->deflate($r->{resbody}, my $buf); @@ -884,9 +879,6 @@ is). There are a few additional optional dependencies: =item * C - required for L, dynamically loaded through C. -=item * L - to support transparent HTTP compression through -Zstandard. - =back